@@ -217,23 +217,11 @@ if (noteViewInterruptors.length > 0) {
});
}
-const isRenote =
- note.renote != null &&
- note.text == null &&
- note.fileIds.length === 0 &&
- note.poll == null;
-
const el = ref
();
const noteEl = $ref();
const menuButton = ref();
-const starButton = ref>();
const renoteButton = ref>();
-const renoteTime = ref();
const reactButton = ref();
-let appearNote = $computed(() =>
- isRenote ? (note.renote as misskey.entities.Note) : note
-);
-const isMyRenote = $i && $i.id === note.userId;
const showContent = ref(false);
const isDeleted = ref(false);
const muted = ref(getWordSoftMute(note, $i, defaultStore.state.mutedWords));
@@ -263,14 +251,14 @@ const keymap = {
useNoteCapture({
rootEl: el,
- note: $$(appearNote),
+ note: $$(note),
isDeletedRef: isDeleted,
});
function reply(viaKeyboard = false): void {
pleaseLogin();
os.post({
- reply: appearNote,
+ reply: note,
animation: !viaKeyboard,
}).then(() => {
focus();
@@ -284,7 +272,7 @@ function react(viaKeyboard = false): void {
reactButton.value,
(reaction) => {
os.api("notes/reactions/create", {
- noteId: appearNote.id,
+ noteId: note.id,
reaction: reaction,
});
},
@@ -355,27 +343,27 @@ function blur() {
directReplies = null;
os.api("notes/children", {
- noteId: appearNote.id,
+ noteId: note.id,
limit: 30,
depth: 12,
}).then((res) => {
res = res.reduce((acc, note) => {
- if (note.userId == appearNote.userId) {
+ if (note.userId == note.userId) {
return [...acc, note];
}
return [note, ...acc];
}, []);
replies.value = res;
directReplies = res
- .filter((note) => note.replyId === appearNote.id)
+ .filter((note) => note.replyId === note.id)
.reverse();
- directQuotes = res.filter((note) => note.renoteId === appearNote.id);
+ directQuotes = res.filter((note) => note.renoteId === note.id);
});
conversation = null;
-if (appearNote.replyId) {
+if (note.replyId) {
os.api("notes/conversation", {
- noteId: appearNote.replyId,
+ noteId: note.replyId,
limit: 30,
}).then((res) => {
conversation = res.reverse();
@@ -385,14 +373,14 @@ if (appearNote.replyId) {
clips = null;
os.api("notes/clips", {
- noteId: appearNote.id,
+ noteId: note.id,
}).then((res) => {
clips = res;
});
// const pagination = {
// endpoint: "notes/renotes",
-// noteId: appearNote.id,
+// noteId: note.id,
// limit: 10,
// };
@@ -402,7 +390,7 @@ renotes = null;
function loadTab() {
if (tab === "renotes" && !renotes) {
os.api("notes/renotes", {
- noteId: appearNote.id,
+ noteId: note.id,
limit: 100,
}).then((res) => {
renotes = res;
@@ -414,7 +402,7 @@ async function onNoteUpdated(noteData: NoteUpdatedEvent): Promise {
const { type, id, body } = noteData;
let found = -1;
- if (id === appearNote.id) {
+ if (id === note.id) {
found = 0;
} else {
for (let i = 0; i < replies.value.length; i++) {
diff --git a/packages/client/src/pages/note.vue b/packages/client/src/pages/note.vue
index e3c0bd7c2d..fbb71bd16c 100644
--- a/packages/client/src/pages/note.vue
+++ b/packages/client/src/pages/note.vue
@@ -13,7 +13,7 @@
:name="$store.state.animation ? 'fade' : ''"
mode="out-in"
>
-