From 6dd2e9fc0b1eeea6b5f04ccac93ccfab658f976d Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Thu, 4 Jul 2024 13:14:49 +0900 Subject: refactor(frontend): refactor popup api and make sure call dispose callback Close #14122 --- packages/frontend/src/scripts/please-login.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/frontend/src/scripts/please-login.ts') diff --git a/packages/frontend/src/scripts/please-login.ts b/packages/frontend/src/scripts/please-login.ts index 9e51272791..363da5f633 100644 --- a/packages/frontend/src/scripts/please-login.ts +++ b/packages/frontend/src/scripts/please-login.ts @@ -11,7 +11,7 @@ import { popup } from '@/os.js'; export function pleaseLogin(path?: string) { if ($i) return; - popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), { + const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), { autoSet: true, message: i18n.ts.signinRequired, }, { @@ -20,7 +20,8 @@ export function pleaseLogin(path?: string) { window.location.href = path; } }, - }, 'closed'); + closed: () => dispose(), + }); throw new Error('signin required'); } -- cgit v1.2.3-freya