fix(frontend): 自動バックアップが設定されていない環境では設定が消滅する旨の警告を出すように (#15802)

* fix(frontend): 自動バックアップが設定されていない環境ではローカルの設定を削除しないように

* Update Changelog

* fix lint

* fix: 警告を出すだけのみにする

* fix

* apply suggestion
This commit is contained in:
かっこかり 2025-04-13 16:59:01 +09:00 committed by GitHub
parent 8edf1bc208
commit f7195d54d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 5 deletions

View File

@ -5,6 +5,7 @@
### Client
- Fix: ログアウトした際に処理が終了しない問題を修正
- Fix: 自動バックアップが設定されている環境でログアウト直前に設定をバックアップするように
### Server
- Fix: システムアカウントの名前がサーバー名と同期されない問題を修正

4
locales/index.d.ts vendored
View File

@ -3934,6 +3934,10 @@ export interface Locale extends ILocale {
*
*/
"logoutConfirm": string;
/**
*
*/
"logoutWillClearClientData": string;
/**
*
*/

View File

@ -979,6 +979,7 @@ document: "ドキュメント"
numberOfPageCache: "ページキャッシュ数"
numberOfPageCacheDescription: "多くすると利便性が向上しますが、負荷とメモリ使用量が増えます。"
logoutConfirm: "ログアウトしますか?"
logoutWillClearClientData: "ログアウトするとクライアントの設定情報がブラウザから消去されます。再ログイン時に設定情報を復元できるようにするためには、設定の自動バックアップを有効にしてください。"
lastActiveDate: "最終利用日時"
statusbar: "ステータスバー"
pleaseSelect: "選択してください"

View File

@ -177,7 +177,8 @@ const menuDef = computed<SuperMenuDef[]>(() => [{
action: async () => {
const { canceled } = await os.confirm({
type: 'warning',
text: i18n.ts.logoutConfirm,
title: i18n.ts.logoutConfirm,
text: i18n.ts.logoutWillClearClientData,
});
if (canceled) return;
signout();

View File

@ -4,7 +4,8 @@
*/
import { apiUrl } from '@@/js/config.js';
import { defaultMemoryStorage } from '@/memory-storage';
import { cloudBackup } from '@/preferences/utility.js';
import { store } from '@/store.js';
import { waiting } from '@/os.js';
import { unisonReload } from '@/utility/unison-reload.js';
import { clear } from '@/utility/idb-proxy.js';
@ -13,12 +14,13 @@ import { $i } from '@/i.js';
export async function signout() {
if (!$i) return;
// TODO: preferの自動バックアップがオンの場合、いろいろ消す前に強制バックアップ
waiting();
if (store.s.enablePreferencesAutoCloudBackup) {
await cloudBackup();
}
localStorage.clear();
defaultMemoryStorage.clear();
const idbAbortController = new AbortController();
const timeout = window.setTimeout(() => idbAbortController.abort(), 5000);