This commit is contained in:
tamaina 2021-12-29 00:03:44 +09:00
parent 2012f4a198
commit f9f64a5e4c

View File

@ -73,8 +73,10 @@ export class Storage<T extends StateDef> {
}, 1); }, 1);
// streamingのuser storage updateイベントを監視して更新 // streamingのuser storage updateイベントを監視して更新
this.connection.on('registryUpdated', ({ scope, key, value }) => { this.connection.on('registryUpdated', ({ scope, key, value }: { scope: string[], key: keyof T, value: T[typeof key]['default'] }) => {
this.state[key] = value as typeof this.state[key]['default']; if (scope[1] !== this.key) return;
this.state[key] = value;
this.reactiveState[key].value = value; this.reactiveState[key].value = value;
const cache = JSON.parse(localStorage.getItem(this.keyForLocalStorage + '::cache::' + $i.id) || '{}'); const cache = JSON.parse(localStorage.getItem(this.keyForLocalStorage + '::cache::' + $i.id) || '{}');