Skip to content

Commit

Permalink
fix: app schemaService
Browse files Browse the repository at this point in the history
  • Loading branch information
dineug committed Jan 1, 2024
1 parent d787994 commit 7df80e1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class SchemaService {
store.setInitialValue(entity.value);
store.on({
change: () => {
this.update(entity.id, { value: store.value });
updateSchemaEntity(this.db, entity.id, { value: store.value });
},
});
this.cache.set(entity.id, { ...entity, store });
Expand All @@ -45,8 +45,8 @@ export class SchemaService {
entityValue: Partial<Pick<SchemaEntity, 'value' | 'name'>>
) {
const result = await updateSchemaEntity(this.db, id, entityValue);

const prev = this.cache.get(id);

if (prev && result) {
this.cache.set(id, { ...prev, ...entityValue });

Expand Down

0 comments on commit 7df80e1

Please sign in to comment.