From d84796588c1472334ddaf696a817f015c245ce44 Mon Sep 17 00:00:00 2001 From: okayurisotto Date: Sat, 8 Jul 2023 07:08:16 +0900 Subject: cleanup: trim trailing whitespace (#11136) * cleanup: trim trailing whitespace * update(`.editorconfig`) --------- Co-authored-by: syuilo --- packages/frontend/src/pizzax.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/frontend/src/pizzax.ts') diff --git a/packages/frontend/src/pizzax.ts b/packages/frontend/src/pizzax.ts index d97bd4be62..996610602b 100644 --- a/packages/frontend/src/pizzax.ts +++ b/packages/frontend/src/pizzax.ts @@ -70,7 +70,7 @@ export class Storage { this.state[k] = v.default; this.reactiveState[k] = ref(v.default); } - + this.ready = this.init(); this.loaded = this.ready.then(() => this.load()); } @@ -81,7 +81,7 @@ export class Storage { const deviceState: State = await get(this.deviceStateKeyName) || {}; const deviceAccountState = $i ? await get(this.deviceAccountStateKeyName) || {} : {}; const registryCache = $i ? await get(this.registryCacheKeyName) || {} : {}; - + for (const [k, v] of Object.entries(this.def) as [keyof T, T[keyof T]['default']][]) { if (v.where === 'device' && Object.prototype.hasOwnProperty.call(deviceState, k)) { this.reactiveState[k].value = this.state[k] = deviceState[k]; @@ -110,7 +110,7 @@ export class Storage { if (!scope || scope.length !== 2 || scope[0] !== 'client' || scope[1] !== this.key || this.state[key] === value) return; this.reactiveState[key].value = this.state[key] = value; - + this.addIdbSetJob(async () => { const cache = await get(this.registryCacheKeyName); if (cache[key] !== value) { @@ -142,7 +142,7 @@ export class Storage { } } } - + return set(this.registryCacheKeyName, cache); }) .then(() => resolve()); @@ -252,7 +252,7 @@ export class Storage { // localStorage => indexedDBのマイグレーション private async migrate() { const deviceState = localStorage.getItem(this.deviceStateKeyName); - if (deviceState) { + if (deviceState) { await set(this.deviceStateKeyName, JSON.parse(deviceState)); localStorage.removeItem(this.deviceStateKeyName); } -- cgit v1.2.3-freya