From 5029d0ac8627059834091421ceb46147efac31ff Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 24 Dec 2021 12:06:11 +0000 Subject: [PATCH] fix: avoid writing mobx data to localforage --- src/mobx/State.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mobx/State.ts b/src/mobx/State.ts index b3e861cc..9c5cf367 100644 --- a/src/mobx/State.ts +++ b/src/mobx/State.ts @@ -104,7 +104,10 @@ export default class State { */ async save() { for (const [id, store] of this.persistent) { - await localforage.setItem(id, store.toJSON()); + await localforage.setItem( + id, + JSON.parse(stringify(store.toJSON())), + ); } }