@@ -217,11 +217,23 @@ 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));
@@ -251,14 +263,14 @@ const keymap = {
useNoteCapture({
rootEl: el,
- note: $$(note),
+ note: $$(appearNote),
isDeletedRef: isDeleted,
});
function reply(viaKeyboard = false): void {
pleaseLogin();
os.post({
- reply: note,
+ reply: appearNote,
animation: !viaKeyboard,
}).then(() => {
focus();
@@ -272,7 +284,7 @@ function react(viaKeyboard = false): void {
reactButton.value,
(reaction) => {
os.api("notes/reactions/create", {
- noteId: note.id,
+ noteId: appearNote.id,
reaction: reaction,
});
},
@@ -343,27 +355,27 @@ function blur() {
directReplies = null;
os.api("notes/children", {
- noteId: note.id,
+ noteId: appearNote.id,
limit: 30,
depth: 12,
}).then((res) => {
res = res.reduce((acc, note) => {
- if (note.userId == note.userId) {
+ if (note.userId == appearNote.userId) {
return [...acc, note];
}
return [note, ...acc];
}, []);
replies.value = res;
directReplies = res
- .filter((note) => note.replyId === note.id)
+ .filter((note) => note.replyId === appearNote.id)
.reverse();
- directQuotes = res.filter((note) => note.renoteId === note.id);
+ directQuotes = res.filter((note) => note.renoteId === appearNote.id);
});
conversation = null;
-if (note.replyId) {
+if (appearNote.replyId) {
os.api("notes/conversation", {
- noteId: note.replyId,
+ noteId: appearNote.replyId,
limit: 30,
}).then((res) => {
conversation = res.reverse();
@@ -373,14 +385,14 @@ if (note.replyId) {
clips = null;
os.api("notes/clips", {
- noteId: note.id,
+ noteId: appearNote.id,
}).then((res) => {
clips = res;
});
// const pagination = {
// endpoint: "notes/renotes",
-// noteId: note.id,
+// noteId: appearNote.id,
// limit: 10,
// };
@@ -390,7 +402,7 @@ renotes = null;
function loadTab() {
if (tab === "renotes" && !renotes) {
os.api("notes/renotes", {
- noteId: note.id,
+ noteId: appearNote.id,
limit: 100,
}).then((res) => {
renotes = res;
@@ -402,7 +414,7 @@ async function onNoteUpdated(noteData: NoteUpdatedEvent): Promise {
const { type, id, body } = noteData;
let found = -1;
- if (id === note.id) {
+ if (id === appearNote.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 fbb71bd16c..e3c0bd7c2d 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"
>
-