diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-02 12:10:51 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-02 12:10:51 +0900 |
| commit | fc244067e059bf88c69ee241e1bfc218517c917b (patch) | |
| tree | 0fe9ecd51d63f0e721db6868c936fa57717bd018 /packages/frontend/src/utility | |
| parent | fix e2e (diff) | |
| download | misskey-fc244067e059bf88c69ee241e1bfc218517c917b.tar.gz misskey-fc244067e059bf88c69ee241e1bfc218517c917b.tar.bz2 misskey-fc244067e059bf88c69ee241e1bfc218517c917b.zip | |
enhnace(frontend): リロードのサジェストをダイアログではなくバナー表示に
Diffstat (limited to 'packages/frontend/src/utility')
| -rw-r--r-- | packages/frontend/src/utility/reload-ask.ts | 40 | ||||
| -rw-r--r-- | packages/frontend/src/utility/reload-suggest.ts | 12 |
2 files changed, 12 insertions, 40 deletions
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; +} |