summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts/get-note-menu.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2024-07-04 13:14:49 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2024-07-04 13:14:49 +0900
commit6dd2e9fc0b1eeea6b5f04ccac93ccfab658f976d (patch)
tree53a677d4fdaa802774a133272ed2f5f1180dd4fa /packages/frontend/src/scripts/get-note-menu.ts
parentfix(storybook): build skipping even after updating impl story files (#14124) (diff)
downloadsharkey-6dd2e9fc0b1eeea6b5f04ccac93ccfab658f976d.tar.gz
sharkey-6dd2e9fc0b1eeea6b5f04ccac93ccfab658f976d.tar.bz2
sharkey-6dd2e9fc0b1eeea6b5f04ccac93ccfab658f976d.zip
refactor(frontend): refactor popup api and make sure call dispose callback
Close #14122
Diffstat (limited to 'packages/frontend/src/scripts/get-note-menu.ts')
-rw-r--r--packages/frontend/src/scripts/get-note-menu.ts18
1 files changed, 13 insertions, 5 deletions
diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts
index 71ad299f50..418b6abc88 100644
--- a/packages/frontend/src/scripts/get-note-menu.ts
+++ b/packages/frontend/src/scripts/get-note-menu.ts
@@ -136,10 +136,12 @@ export function getAbuseNoteMenu(note: Misskey.entities.Note, text: string): Men
let noteInfo = '';
if (note.url ?? note.uri != null) noteInfo = `Note: ${note.url ?? note.uri}\n`;
noteInfo += `Local Note: ${localUrl}\n`;
- os.popup(defineAsyncComponent(() => import('@/components/MkAbuseReportWindow.vue')), {
+ const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkAbuseReportWindow.vue')), {
user: note.user,
initialComment: `${noteInfo}-----\n`,
- }, {}, 'closed');
+ }, {
+ closed: () => dispose(),
+ });
},
};
}
@@ -530,7 +532,9 @@ export function getRenoteMenu(props: {
const rect = el.getBoundingClientRect();
const x = rect.left + (el.offsetWidth / 2);
const y = rect.top + (el.offsetHeight / 2);
- os.popup(MkRippleEffect, { x, y }, {}, 'end');
+ const { dispose } = os.popup(MkRippleEffect, { x, y }, {
+ end: () => dispose(),
+ });
}
if (!props.mock) {
@@ -566,7 +570,9 @@ export function getRenoteMenu(props: {
const rect = el.getBoundingClientRect();
const x = rect.left + (el.offsetWidth / 2);
const y = rect.top + (el.offsetHeight / 2);
- os.popup(MkRippleEffect, { x, y }, {}, 'end');
+ const { dispose } = os.popup(MkRippleEffect, { x, y }, {
+ end: () => dispose(),
+ });
}
const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility;
@@ -615,7 +621,9 @@ export function getRenoteMenu(props: {
const rect = el.getBoundingClientRect();
const x = rect.left + (el.offsetWidth / 2);
const y = rect.top + (el.offsetHeight / 2);
- os.popup(MkRippleEffect, { x, y }, {}, 'end');
+ const { dispose } = os.popup(MkRippleEffect, { x, y }, {
+ end: () => dispose(),
+ });
}
if (!props.mock) {