From 1d9a4f68f472def57c259290cfacb7b7d238e490 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 19 May 2022 13:28:08 +0200 Subject: Refactor pleaseLogin to show a sign-in dialog (#8630) * refactor(client): refactor pleaseLogin to show a sign-in dialog * Apply review suggestions from @Johann150 Co-authored-by: Johann150 Co-authored-by: Johann150 Co-authored-by: syuilo --- packages/client/src/scripts/please-login.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'packages/client/src/scripts') diff --git a/packages/client/src/scripts/please-login.ts b/packages/client/src/scripts/please-login.ts index aeaafa124b..e21a6d2ed3 100644 --- a/packages/client/src/scripts/please-login.ts +++ b/packages/client/src/scripts/please-login.ts @@ -1,14 +1,21 @@ +import { defineAsyncComponent } from 'vue'; import { $i } from '@/account'; import { i18n } from '@/i18n'; -import { alert } from '@/os'; +import { popup } from '@/os'; -export function pleaseLogin() { +export function pleaseLogin(path?: string) { if ($i) return; - alert({ - title: i18n.ts.signinRequired, - text: null - }); + popup(defineAsyncComponent(() => import('@/components/signin-dialog.vue')), { + autoSet: true, + message: i18n.ts.signinRequired + }, { + cancelled: () => { + if (path) { + window.location.href = path; + } + }, + }, 'closed'); throw new Error('signin required'); } -- cgit v1.2.3-freya From 4a50c49211654758d391b39d78fe4d171afc1f19 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 28 May 2022 21:59:23 +0900 Subject: Fix theme import (#8749) --- packages/client/@types/theme.d.ts | 8 ++-- .../client/src/pages/settings/theme.manage.vue | 11 ++--- packages/client/src/pages/settings/theme.vue | 5 ++- packages/client/src/pages/theme-editor.vue | 4 +- packages/client/src/scripts/theme.ts | 51 +++++++++++++--------- 5 files changed, 47 insertions(+), 32 deletions(-) (limited to 'packages/client/src/scripts') diff --git a/packages/client/@types/theme.d.ts b/packages/client/@types/theme.d.ts index b8b906b82e..67f724a9aa 100644 --- a/packages/client/@types/theme.d.ts +++ b/packages/client/@types/theme.d.ts @@ -1,5 +1,7 @@ -import { Theme } from '../src/scripts/theme'; - declare module '@/themes/*.json5' { - export = Theme; + import { Theme } from "@/scripts/theme"; + + const theme: Theme; + + export default theme; } diff --git a/packages/client/src/pages/settings/theme.manage.vue b/packages/client/src/pages/settings/theme.manage.vue index 7da439f9c0..94b2d24455 100644 --- a/packages/client/src/pages/settings/theme.manage.vue +++ b/packages/client/src/pages/settings/theme.manage.vue @@ -10,13 +10,13 @@