Skip to content

Commit ed01c97

Browse files
committed
fix: apply fromSerializableObject to objects emitted from storageChange$
set()/get() applies toSerializableObject/fromSerializableObject respectively storageChange$ did not, resulting in emitting slightly different objects that were not processed by fromSerializableObject util this broke disabling accounts that were just enabled and possibly some other functionality
1 parent 5cae3b4 commit ed01c97

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/browser-extension-wallet/src/lib/scripts/background/storage/extension-store.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { storage as extensionStorage, Storage } from 'webextension-polyfill';
33
import { fromEventPattern, mergeMap, Observable, share } from 'rxjs';
44
import { Logger } from 'ts-log';
5+
import { fromSerializableObject } from '@cardano-sdk/util';
56

67
export abstract class ExtensionStore {
78
protected readonly storageChange$: Observable<{ key: string; change: Storage.StorageChange }>;
@@ -13,7 +14,9 @@ export abstract class ExtensionStore {
1314
(handler) => this.storage.onChanged.addListener(handler),
1415
(handler) => this.storage.onChanged.removeListener(handler)
1516
).pipe(
16-
mergeMap((changes) => Object.entries(changes).map(([key, change]) => ({ key, change }))),
17+
mergeMap((changes) =>
18+
Object.entries(changes).map(([key, change]) => ({ key, change: fromSerializableObject(change) }))
19+
),
1720
share()
1821
);
1922
}

0 commit comments

Comments
 (0)