summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkNote.vue
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-08-17 11:28:22 +0900
committerGitHub <noreply@github.com>2024-08-17 11:28:22 +0900
commit059eb6d379cc84ee48c76bcea88dd90423f4f929 (patch)
tree484f0274242d7013e6feaa6e5860f11e3d00ede6 /packages/frontend/src/components/MkNote.vue
parentNew Crowdin updates (#14393) (diff)
downloadmisskey-059eb6d379cc84ee48c76bcea88dd90423f4f929.tar.gz
misskey-059eb6d379cc84ee48c76bcea88dd90423f4f929.tar.bz2
misskey-059eb6d379cc84ee48c76bcea88dd90423f4f929.zip
fix(frontend): リノートの判定が甘いのを修正 (#14396)
* fix(frontend): リノートの判定が甘いのを修正 * fix * Update Changelog * fix * use type assertion * fix + add comments * lint * misskey-jsに移動 * PureRenote -> Renote * isRenote -> isPureRenote
Diffstat (limited to 'packages/frontend/src/components/MkNote.vue')
-rw-r--r--packages/frontend/src/components/MkNote.vue12
1 files changed, 3 insertions, 9 deletions
diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue
index 13273a53b4..32d1cc5640 100644
--- a/packages/frontend/src/components/MkNote.vue
+++ b/packages/frontend/src/components/MkNote.vue
@@ -200,6 +200,7 @@ import { host } from '@/config.js';
import { isEnabledUrlPreview } from '@/instance.js';
import { type Keymap } from '@/scripts/hotkey.js';
import { focusPrev, focusNext } from '@/scripts/focus.js';
+import { getAppearNote } from '@/scripts/get-appear-note.js';
const props = withDefaults(defineProps<{
note: Misskey.entities.Note;
@@ -242,14 +243,7 @@ if (noteViewInterruptors.length > 0) {
});
}
-const isRenote = (
- note.value.renote != null &&
- note.value.reply == null &&
- note.value.text == null &&
- note.value.cw == null &&
- note.value.fileIds && note.value.fileIds.length === 0 &&
- note.value.poll == null
-);
+const isRenote = Misskey.note.isPureRenote(note.value);
const rootEl = shallowRef<HTMLElement>();
const menuButton = shallowRef<HTMLElement>();
@@ -257,7 +251,7 @@ const renoteButton = shallowRef<HTMLElement>();
const renoteTime = shallowRef<HTMLElement>();
const reactButton = shallowRef<HTMLElement>();
const clipButton = shallowRef<HTMLElement>();
-const appearNote = computed(() => isRenote ? note.value.renote as Misskey.entities.Note : note.value);
+const appearNote = computed(() => getAppearNote(note.value));
const galleryEl = shallowRef<InstanceType<typeof MkMediaList>>();
const isMyRenote = $i && ($i.id === note.value.userId);
const showContent = ref(false);