fix
This commit is contained in:
parent
f6c2fae089
commit
be2e596027
|
@ -473,7 +473,8 @@ function showReactions(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
const unuse = ref<() => void>();
|
const unuse = ref<() => void>();
|
||||||
unuse.value = noteManager.useNote(props.note.id, true).unuse;
|
|
||||||
|
unuse.value = noteManager.useNote(appearNote.value?.id ?? props.note.id, true).unuse;
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
executeInterruptor();
|
executeInterruptor();
|
||||||
|
@ -488,19 +489,20 @@ onUnmounted(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
if (!unuse.value) {
|
if (!unuse.value && appearNote.value) {
|
||||||
unuse.value = noteManager.useNote(props.note.id, true).unuse;
|
unuse.value = noteManager.useNote(appearNote.value?.id ?? props.note.id, true).unuse;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onDeactivated(() => {
|
onDeactivated(() => {
|
||||||
|
const _unuse = unuse.value;
|
||||||
|
unuse.value = undefined;
|
||||||
// 不要なキャッシュ消去や通信を防止するため遅延させる
|
// 不要なキャッシュ消去や通信を防止するため遅延させる
|
||||||
setTimeout(() => {
|
if (_unuse) {
|
||||||
if (unuse.value) {
|
setTimeout(() => {
|
||||||
unuse.value();
|
_unuse();
|
||||||
unuse.value = undefined;
|
}, 1000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -407,7 +407,7 @@ function blur() {
|
||||||
el.value?.blur();
|
el.value?.blur();
|
||||||
}
|
}
|
||||||
|
|
||||||
const { note: fetching, unuse } = noteManager.useNote(props.note.id, true);
|
const { note: fetching, unuse } = noteManager.useNote(appearNote.value?.id ?? props.note.id, true);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetching;
|
await fetching;
|
||||||
|
|
|
@ -47,6 +47,14 @@ type CachedNoteSource = Ref<OmittedNote | null>;
|
||||||
type CachedNote = ComputedRef<Note | null>;
|
type CachedNote = ComputedRef<Note | null>;
|
||||||
type InterruptedCachedNote = Ref<Note | null>;
|
type InterruptedCachedNote = Ref<Note | null>;
|
||||||
|
|
||||||
|
export function isRenote(note: Note | OmittedNote): boolean {
|
||||||
|
return note != null &&
|
||||||
|
note.renoteId != null &&
|
||||||
|
note.text == null &&
|
||||||
|
note.fileIds?.length === 0 &&
|
||||||
|
note.poll == null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ノートのキャッシュを管理する
|
* ノートのキャッシュを管理する
|
||||||
* 基本的な使い方:
|
* 基本的な使い方:
|
||||||
|
@ -197,14 +205,7 @@ export class NoteManager {
|
||||||
*/
|
*/
|
||||||
public getNoteViewBase(id: string) {
|
public getNoteViewBase(id: string) {
|
||||||
const { interruptedNote: note, interruptorUnwatch, executeInterruptor } = this.getInterrupted(id);
|
const { interruptedNote: note, interruptorUnwatch, executeInterruptor } = this.getInterrupted(id);
|
||||||
//const note = this.get(id);
|
const isRenote = computed(() => isRenote(note.value));
|
||||||
const isRenote = computed(() => (
|
|
||||||
note.value != null &&
|
|
||||||
note.value.renote != null &&
|
|
||||||
note.value.text == null &&
|
|
||||||
note.value.fileIds?.length === 0 &&
|
|
||||||
note.value.poll == null
|
|
||||||
));
|
|
||||||
const isMyRenote = computed(() => $i && ($i.id === note.value?.userId));
|
const isMyRenote = computed(() => $i && ($i.id === note.value?.userId));
|
||||||
const appearNote = computed(() => (isRenote.value ? note.value?.renote : note.value) ?? null);
|
const appearNote = computed(() => (isRenote.value ? note.value?.renote : note.value) ?? null);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue