diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-05-07 16:10:43 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-05-07 16:10:43 +0900 |
| commit | 5603cb7e2246fd146d23522149bad7dd99549dad (patch) | |
| tree | 67b7853ec6d5928584badd710246484b4962b72a /packages/frontend/src | |
| parent | 🎨 (diff) | |
| download | misskey-5603cb7e2246fd146d23522149bad7dd99549dad.tar.gz misskey-5603cb7e2246fd146d23522149bad7dd99549dad.tar.bz2 misskey-5603cb7e2246fd146d23522149bad7dd99549dad.zip | |
refactor
Diffstat (limited to 'packages/frontend/src')
| -rw-r--r-- | packages/frontend/src/preferences.ts | 2 | ||||
| -rw-r--r-- | packages/frontend/src/preferences/manager.ts | 4 | ||||
| -rw-r--r-- | packages/frontend/src/preferences/utility.ts | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/packages/frontend/src/preferences.ts b/packages/frontend/src/preferences.ts index 73c89e23af..2208f75094 100644 --- a/packages/frontend/src/preferences.ts +++ b/packages/frontend/src/preferences.ts @@ -86,7 +86,7 @@ const storageProvider: StorageProvider = { }); }, - cloudGets: async (ctx) => { + cloudGetBulk: async (ctx) => { // TODO: 値の取得を1つのリクエストで済ませたい(バックエンド側でAPIの新設が必要) const fetchings = ctx.needs.map(need => storageProvider.cloudGet(need).then(res => [need.key, res] as const)); const cloudDatas = await Promise.all(fetchings); diff --git a/packages/frontend/src/preferences/manager.ts b/packages/frontend/src/preferences/manager.ts index f96aa2f368..cac659f1fe 100644 --- a/packages/frontend/src/preferences/manager.ts +++ b/packages/frontend/src/preferences/manager.ts @@ -79,7 +79,7 @@ export type PreferencesProfile = { export type StorageProvider = { save: (ctx: { profile: PreferencesProfile; }) => void; - cloudGets: <K extends keyof PREF>(ctx: { needs: { key: K; scope: Scope; }[] }) => Promise<Partial<Record<K, ValueOf<K>>>>; + cloudGetBulk: <K extends keyof PREF>(ctx: { needs: { key: K; scope: Scope; }[] }) => Promise<Partial<Record<K, ValueOf<K>>>>; cloudGet: <K extends keyof PREF>(ctx: { key: K; scope: Scope; }) => Promise<{ value: ValueOf<K>; } | null>; cloudSet: <K extends keyof PREF>(ctx: { key: K; scope: Scope; value: ValueOf<K>; }) => Promise<void>; }; @@ -240,7 +240,7 @@ export class PreferencesManager { } } - const cloudValues = await this.storageProvider.cloudGets({ needs }); + const cloudValues = await this.storageProvider.cloudGetBulk({ needs }); for (const _key in PREF_DEF) { const key = _key as keyof PREF; diff --git a/packages/frontend/src/preferences/utility.ts b/packages/frontend/src/preferences/utility.ts index af5b178df6..a6687251af 100644 --- a/packages/frontend/src/preferences/utility.ts +++ b/packages/frontend/src/preferences/utility.ts @@ -140,7 +140,7 @@ function importProfile() { export async function cloudBackup() { if ($i == null) return; if (!canAutoBackup()) { - throw new Error('Profile name is not set'); + throw new Error('cannot auto backup for this profile'); } await misskeyApi('i/registry/set', { |