Skip to content

Commit

Permalink
fix: dexie update hook
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Mar 10, 2023
1 parent e355a44 commit cf6f65b
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Workspace, number>;
Expand Down Expand Up @@ -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() };
});
});
}
Expand Down

0 comments on commit cf6f65b

Please sign in to comment.