diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-13 09:02:38 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-13 09:02:38 +0900 |
| commit | 9b2af53025eda12262db3633d47940fab28239d8 (patch) | |
| tree | 91fc141ba6d203d4e0f454f081a2d0e8d7efbfc5 /packages/frontend/src/preferences/manager.ts | |
| parent | enhance(frontend): make deck profiles syncable (diff) | |
| download | misskey-9b2af53025eda12262db3633d47940fab28239d8.tar.gz misskey-9b2af53025eda12262db3633d47940fab28239d8.tar.bz2 misskey-9b2af53025eda12262db3633d47940fab28239d8.zip | |
enhance(frontend): improve pref manager
Diffstat (limited to 'packages/frontend/src/preferences/manager.ts')
| -rw-r--r-- | packages/frontend/src/preferences/manager.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/frontend/src/preferences/manager.ts b/packages/frontend/src/preferences/manager.ts index 3f3eba6389..f42a9be25f 100644 --- a/packages/frontend/src/preferences/manager.ts +++ b/packages/frontend/src/preferences/manager.ts @@ -94,6 +94,7 @@ export type PreferencesDefinition = Record<string, { export class ProfileManager { private storageProvider: StorageProvider; public profile: PreferencesProfile; + public cloudReady: Promise<void>; /** * static / state の略 (static が予約語のため) @@ -120,7 +121,7 @@ export class ProfileManager { this.r[key] = ref(this.s[key]); } - this.fetchCloudValues(); + this.cloudReady = this.fetchCloudValues(); // TODO: 定期的にクラウドの値をフェッチ } @@ -226,7 +227,7 @@ export class ProfileManager { const record = this.getMatchedRecordOf(key); if (record[2].sync && Object.hasOwn(cloudValues, key) && cloudValues[key] !== undefined) { const cloudValue = cloudValues[key]; - if (cloudValue !== this.s[key]) { + if (!deepEqual(cloudValue, record[1])) { this.rewriteRawState(key, cloudValue); record[1] = cloudValue; console.log('cloud fetched', key, cloudValue); |