From cf6f65ba839ef384acc02ad96f0986c33782a164 Mon Sep 17 00:00:00 2001 From: buqiyuan <1743369777@qq.com> Date: Fri, 10 Mar 2023 22:16:11 +0800 Subject: [PATCH] fix: dexie update hook --- .../src/app/shared/services/storage/db/dataSource/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/workbench/browser/src/app/shared/services/storage/db/dataSource/index.ts b/src/workbench/browser/src/app/shared/services/storage/db/dataSource/index.ts index e34bbaece..ec76471ff 100644 --- a/src/workbench/browser/src/app/shared/services/storage/db/dataSource/index.ts +++ b/src/workbench/browser/src/app/shared/services/storage/db/dataSource/index.ts @@ -12,7 +12,6 @@ import { } from 'eo/workbench/browser/src/app/shared/services/storage/db/models'; import { ProjectService } from 'eo/workbench/browser/src/app/shared/services/storage/db/services/project.service'; import { WorkspaceService } from 'eo/workbench/browser/src/app/shared/services/storage/db/services/workspace.service'; -import { merge } from 'lodash-es'; class DataSource extends Dexie { workspace!: Table; @@ -75,8 +74,7 @@ class DataSource extends Dexie { return obj; }); table.hook('updating', (modifications, primKey, obj) => { - const newObj = merge({}, obj, modifications); - return { ...newObj, updateTime: Date.now() }; + return { ...modifications, updateTime: Date.now() }; }); }); }