Sending change signal on delete
This commit is contained in:
parent
15df0351a4
commit
a78e98a0c8
@ -139,12 +139,12 @@ export default class Query {
|
||||
}
|
||||
|
||||
async set(value: any) {
|
||||
if (value === null || value === undefined)
|
||||
return this.delete(value);
|
||||
|
||||
const lock = await this.database.locks.lock(this.path);
|
||||
let batch = this.database.level.batch();
|
||||
try {
|
||||
if (value === null || value === undefined) {
|
||||
this.delete(value);
|
||||
} else {
|
||||
let field = await this.getField(this.path);
|
||||
if (field) {
|
||||
await this.delete(batch);
|
||||
@ -181,6 +181,7 @@ export default class Query {
|
||||
}
|
||||
|
||||
saveValue(this.path, value);
|
||||
}
|
||||
|
||||
await batch.write();
|
||||
this.database.changeObservable.send({
|
||||
|
@ -36,8 +36,6 @@ Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) {
|
||||
});
|
||||
|
||||
|
||||
const formsTemplate = Handlebars.compile(readFileSync("./views/forms.hbs").toString());
|
||||
|
||||
const cache = new Map<string, Handlebars.TemplateDelegate>();
|
||||
|
||||
export default function getTemplate(name: string) {
|
||||
|
Reference in New Issue
Block a user