Browse Source

fix: save data copy to memory

Sv443 11 tháng trước cách đây
mục cha
commit
c796187733
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      lib/DataStore.ts

+ 1 - 1
lib/DataStore.ts

@@ -117,7 +117,7 @@ export class DataStore<TData = any> {
       if(gmFmtVer < this.formatVersion && this.migrations)
         parsed = await this.runMigrations(parsed, gmFmtVer);
 
-      return { ...(this.cachedData = parsed) };
+      return this.cachedData = { ...parsed };
     }
     catch(err) {
       console.warn("Error while parsing JSON data, resetting it to the default value.", err);