diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-04-07 10:21:49 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-04-07 10:21:49 +0900 |
| commit | 6ef5c8bb9243e0fbc0d4d539b967c908146f544c (patch) | |
| tree | 1c2402ecec9002f1a18f8c98aca109f13ffe4a50 /packages | |
| parent | fix(ci): fix Chromatic CI not being skipped for dependency update branches (#... (diff) | |
| download | sharkey-6ef5c8bb9243e0fbc0d4d539b967c908146f544c.tar.gz sharkey-6ef5c8bb9243e0fbc0d4d539b967c908146f544c.tar.bz2 sharkey-6ef5c8bb9243e0fbc0d4d539b967c908146f544c.zip | |
enhance(frontend): improve migration of old settings
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/frontend/src/components/MkWaitingDialog.vue | 2 | ||||
| -rw-r--r-- | packages/frontend/src/os.ts | 3 | ||||
| -rw-r--r-- | packages/frontend/src/pages/settings/other.vue | 1 | ||||
| -rw-r--r-- | packages/frontend/src/pref-migrate.ts | 15 |
4 files changed, 13 insertions, 8 deletions
diff --git a/packages/frontend/src/components/MkWaitingDialog.vue b/packages/frontend/src/components/MkWaitingDialog.vue index 282da00ee1..820cf05e1f 100644 --- a/packages/frontend/src/components/MkWaitingDialog.vue +++ b/packages/frontend/src/components/MkWaitingDialog.vue @@ -22,7 +22,7 @@ const modal = useTemplateRef('modal'); const props = defineProps<{ success: boolean; showing: boolean; - text?: string; + text?: string | null; }>(); const emit = defineEmits<{ diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 63298d9407..813b49635d 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -547,12 +547,13 @@ export function success(): Promise<void> { }); } -export function waiting(): Promise<void> { +export function waiting(text?: string | null): Promise<void> { return new Promise(resolve => { const showing = ref(true); const { dispose } = popup(MkWaitingDialog, { success: false, showing: showing, + text, }, { done: () => resolve(), closed: () => dispose(), diff --git a/packages/frontend/src/pages/settings/other.vue b/packages/frontend/src/pages/settings/other.vue index 6736572e0b..58fcb0c5e0 100644 --- a/packages/frontend/src/pages/settings/other.vue +++ b/packages/frontend/src/pages/settings/other.vue @@ -185,7 +185,6 @@ async function deleteAccount() { } function migrate() { - os.waiting(); migrateOldSettings(); } diff --git a/packages/frontend/src/pref-migrate.ts b/packages/frontend/src/pref-migrate.ts index cb5e817f0e..414bb9c5aa 100644 --- a/packages/frontend/src/pref-migrate.ts +++ b/packages/frontend/src/pref-migrate.ts @@ -10,14 +10,19 @@ import { prefer } from '@/preferences.js'; import { misskeyApi } from '@/utility/misskey-api.js'; import { deckStore } from '@/ui/deck/deck-store.js'; import { unisonReload } from '@/utility/unison-reload.js'; +import * as os from '@/os.js'; +import { i18n } from '@/i18n.js'; // TODO: そのうち消す export function migrateOldSettings() { + os.waiting(i18n.ts.settingsMigrating); + store.loaded.then(async () => { - const themes = await misskeyApi('i/registry/get', { scope: ['client'], key: 'themes' }).catch(() => []); - if (themes.length > 0) { - prefer.commit('themes', themes); - } + misskeyApi('i/registry/get', { scope: ['client'], key: 'themes' }).catch(() => []).then((themes: any) => { + if (themes.length > 0) { + prefer.commit('themes', themes); + } + }); const plugins = ColdDeviceStorage.get('plugins'); prefer.commit('plugins', plugins.map(p => ({ @@ -136,6 +141,6 @@ export function migrateOldSettings() { window.setTimeout(() => { unisonReload(); - }, 5000); + }, 10000); }); } |