From c2b825b3000e6d953a3ba54910a898986cd72ee9 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 14 Aug 2024 12:28:57 +0100 Subject: [PATCH] a few more fixes to `os.popup` calls --- packages/frontend/src/components/MkNote.vue | 6 ++++-- packages/frontend/src/components/SkNote.vue | 6 ++++-- packages/frontend/src/scripts/get-note-versions-menu.ts | 5 +++-- packages/frontend/src/widgets/WidgetSearch.vue | 5 +++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index e5710d5513..b33a0ba694 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -455,12 +455,14 @@ if (!props.mock) { if (users.length < 1) return; - os.popup(MkUsersTooltip, { + const { dispose } = os.popup(MkUsersTooltip, { showing, users, count: appearNote.value.renoteCount, targetElement: quoteButton.value, - }, {}, 'closed'); + }, { + closed: () => dispose(), + }); }); if ($i) { diff --git a/packages/frontend/src/components/SkNote.vue b/packages/frontend/src/components/SkNote.vue index 5f416a639d..5bad2a2d13 100644 --- a/packages/frontend/src/components/SkNote.vue +++ b/packages/frontend/src/components/SkNote.vue @@ -455,12 +455,14 @@ if (!props.mock) { if (users.length < 1) return; - os.popup(MkUsersTooltip, { + const { dispose } = os.popup(MkUsersTooltip, { showing, users, count: appearNote.value.renoteCount, targetElement: quoteButton.value, - }, {}, 'closed'); + }, { + closed: () => dispose(), + }); }); if ($i) { diff --git a/packages/frontend/src/scripts/get-note-versions-menu.ts b/packages/frontend/src/scripts/get-note-versions-menu.ts index 9108191d73..345cec9018 100644 --- a/packages/frontend/src/scripts/get-note-versions-menu.ts +++ b/packages/frontend/src/scripts/get-note-versions-menu.ts @@ -27,12 +27,13 @@ export async function getNoteVersionsMenu(props: { const cleanups = [] as (() => void)[]; function openVersion(info): void { - os.popup(defineAsyncComponent(() => import('@/components/SkOldNoteWindow.vue')), { + const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/SkOldNoteWindow.vue')), { note: appearNote, oldText: info.text, updatedAt: info.oldDate ? info.oldDate : info.updatedAt, }, { - }, 'closed'); + closed: () => dispose(), + }); } const menu: MenuItem[] = []; diff --git a/packages/frontend/src/widgets/WidgetSearch.vue b/packages/frontend/src/widgets/WidgetSearch.vue index aeb1bc6ee0..294c97e293 100644 --- a/packages/frontend/src/widgets/WidgetSearch.vue +++ b/packages/frontend/src/widgets/WidgetSearch.vue @@ -143,11 +143,12 @@ async function search() { key.value++; - os.popup(defineAsyncComponent(() => import('@/components/SkSearchResultWindow.vue')), { + const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/SkSearchResultWindow.vue')), { noteKey: key.value, notePagination: notePagination.value, }, { - }, 'closed'); + closed: () => dispose(), + }); } defineExpose({