From fc244067e059bf88c69ee241e1bfc218517c917b Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sat, 2 Aug 2025 12:10:51 +0900 Subject: enhnace(frontend): リロードのサジェストをダイアログではなくバナー表示に MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/utility/reload-ask.ts | 40 ------------------------- packages/frontend/src/utility/reload-suggest.ts | 12 ++++++++ 2 files changed, 12 insertions(+), 40 deletions(-) delete mode 100644 packages/frontend/src/utility/reload-ask.ts create mode 100644 packages/frontend/src/utility/reload-suggest.ts (limited to 'packages/frontend/src/utility') diff --git a/packages/frontend/src/utility/reload-ask.ts b/packages/frontend/src/utility/reload-ask.ts deleted file mode 100644 index 7c7ea113d4..0000000000 --- a/packages/frontend/src/utility/reload-ask.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { i18n } from '@/i18n.js'; -import * as os from '@/os.js'; -import { unisonReload } from '@/utility/unison-reload.js'; - -let isReloadConfirming = false; - -export async function reloadAsk(opts: { - unison?: boolean; - reason?: string; -}) { - if (isReloadConfirming) { - return; - } - - isReloadConfirming = true; - - const { canceled } = await os.confirm(opts.reason == null ? { - type: 'info', - text: i18n.ts.reloadConfirm, - } : { - type: 'info', - title: i18n.ts.reloadConfirm, - text: opts.reason, - }).finally(() => { - isReloadConfirming = false; - }); - - if (canceled) return; - - if (opts.unison) { - unisonReload(); - } else { - window.location.reload(); - } -} diff --git a/packages/frontend/src/utility/reload-suggest.ts b/packages/frontend/src/utility/reload-suggest.ts new file mode 100644 index 0000000000..f1888f721e --- /dev/null +++ b/packages/frontend/src/utility/reload-suggest.ts @@ -0,0 +1,12 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { ref } from 'vue'; + +export const shouldSuggestReload = ref(false); + +export function suggestReload() { + shouldSuggestReload.value = true; +} -- cgit v1.2.3-freya