浏览代码

fix: save data copy to memory

Sv443 11 月之前
父节点
当前提交
c796187733
共有 1 个文件被更改,包括 1 次插入1 次删除
  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);