improve performance

This commit is contained in:
syuilo 2022-11-17 09:31:07 +09:00
parent 746fac0dfe
commit d5aee2ea58
14 changed files with 88 additions and 44 deletions

View file

@ -139,6 +139,7 @@ import { $i } from '@/account';
import { i18n } from '@/i18n';
import { getNoteMenu } from '@/scripts/get-note-menu';
import { useNoteCapture } from '@/scripts/use-note-capture';
import { deepClone } from '@/scripts/clone';
const props = defineProps<{
note: misskey.entities.Note;
@ -147,12 +148,12 @@ const props = defineProps<{
const inChannel = inject('inChannel', null);
let note = $ref(JSON.parse(JSON.stringify(props.note)));
let note = $ref(deepClone(props.note));
// plugin
if (noteViewInterruptors.length > 0) {
onMounted(async () => {
let result = JSON.parse(JSON.stringify(note));
let result = deepClone(note);
for (const interruptor of noteViewInterruptors) {
result = await interruptor.handler(result);
}