diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-02-11 22:14:14 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-02-11 22:14:14 +0900 |
| commit | b01a0325ba8b682da7fc44764d6abb9c320aa90e (patch) | |
| tree | a5a7d27550ecba884811eca1bfb6e4c4e931a185 /packages/client/src | |
| parent | 12.106.2 (diff) | |
| download | sharkey-b01a0325ba8b682da7fc44764d6abb9c320aa90e.tar.gz sharkey-b01a0325ba8b682da7fc44764d6abb9c320aa90e.tar.bz2 sharkey-b01a0325ba8b682da7fc44764d6abb9c320aa90e.zip | |
fix(client): ノート詳細が開けないのを直したり
Fix #8305
Diffstat (limited to 'packages/client/src')
| -rw-r--r-- | packages/client/src/components/note-detailed.vue | 23 | ||||
| -rw-r--r-- | packages/client/src/components/note.vue | 2 |
2 files changed, 14 insertions, 11 deletions
diff --git a/packages/client/src/components/note-detailed.vue b/packages/client/src/components/note-detailed.vue index 5fc3a0f334..80233d608a 100644 --- a/packages/client/src/components/note-detailed.vue +++ b/packages/client/src/components/note-detailed.vue @@ -154,11 +154,13 @@ const props = defineProps<{ const inChannel = inject('inChannel', null); +const note = $ref(JSON.parse(JSON.stringify(props.note))); + const isRenote = ( - props.note.renote != null && - props.note.text == null && - props.note.fileIds.length === 0 && - props.note.poll == null + note.renote != null && + note.text == null && + note.fileIds.length === 0 && + note.poll == null ); const el = ref<HTMLElement>(); @@ -166,8 +168,8 @@ const menuButton = ref<HTMLElement>(); const renoteButton = ref<InstanceType<typeof XRenoteButton>>(); const renoteTime = ref<HTMLElement>(); const reactButton = ref<HTMLElement>(); -let appearNote = $ref(isRenote ? props.note.renote as misskey.entities.Note : props.note); -const isMyRenote = $i && ($i.id === props.note.userId); +let appearNote = $ref(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(checkWordMute(appearNote, $i, defaultStore.state.mutedWords)); @@ -188,8 +190,9 @@ const keymap = { }; useNoteCapture({ - appearNote: $$(appearNote), rootEl: el, + note: $$(appearNote), + isDeletedRef: isDeleted, }); function reply(viaKeyboard = false): void { @@ -237,12 +240,12 @@ function onContextmenu(ev: MouseEvent): void { ev.preventDefault(); react(); } else { - os.contextMenu(getNoteMenu({ note: props.note, translating, translation, menuButton }), ev).then(focus); + os.contextMenu(getNoteMenu({ note: note, translating, translation, menuButton }), ev).then(focus); } } function menu(viaKeyboard = false): void { - os.popupMenu(getNoteMenu({ note: props.note, translating, translation, menuButton }), menuButton.value, { + os.popupMenu(getNoteMenu({ note: note, translating, translation, menuButton }), menuButton.value, { viaKeyboard }).then(focus); } @@ -255,7 +258,7 @@ function showRenoteMenu(viaKeyboard = false): void { danger: true, action: () => { os.api('notes/delete', { - noteId: props.note.id + noteId: note.id }); isDeleted.value = true; } diff --git a/packages/client/src/components/note.vue b/packages/client/src/components/note.vue index 7cf5fb0474..93286a28b2 100644 --- a/packages/client/src/components/note.vue +++ b/packages/client/src/components/note.vue @@ -180,7 +180,7 @@ const keymap = { useNoteCapture({ rootEl: el, note: $$(appearNote), - isDeletedRef: $$(isDeleted), + isDeletedRef: isDeleted, }); function reply(viaKeyboard = false): void { |