Skip to content

Commit

Permalink
fix(core): always serialize when storing
Browse files Browse the repository at this point in the history
  • Loading branch information
BroKun committed Aug 27, 2024
1 parent 06bdadd commit 8174a13
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .changeset/spotty-coins-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@difizen/mana-observable': patch
'@difizen/umi-plugin-mana': patch
'@difizen/mana-syringe': patch
'@difizen/mana-common': patch
'@difizen/mana-react': patch
'@difizen/mana-core': patch
'@difizen/mana-l10n': patch
'@difizen/mana-app': patch
'@difizen/mana-ui': patch
'@difizen/mana-docs': patch
---

Always serialize when storing.
2 changes: 1 addition & 1 deletion packages/mana-core/src/common/storage-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class LocalStorageService implements StorageService {
setData<T>(key: string, data?: T): MaybePromise<void> {
if (data !== undefined) {
try {
const value = typeof data === 'string' ? data : JSON.stringify(data);
const value = JSON.stringify(data);
this.storage[this.prefix(key)] = value;
} catch (e) {
this.onDiskQuotaExceededEmitter.fire();
Expand Down

0 comments on commit 8174a13

Please sign in to comment.