user-friendly wallpaper; some fixes

This commit is contained in:
end-4
2024-01-19 19:30:51 +07:00
parent 15df48dc0e
commit 898b416945
18 changed files with 547 additions and 385 deletions
+8 -6
View File
@@ -32,24 +32,26 @@ class TodoService extends Service {
return this._todoJson;
}
add(content) {
this._todoJson.push({ content, done: false });
_save() {
Utils.writeFile(JSON.stringify(this._todoJson), this._todoPath)
.catch(print);
}
add(content) {
this._todoJson.push({ content, done: false });
this._save();
this.emit('updated');
}
check(index) {
this._todoJson[index].done = true;
Utils.writeFile(JSON.stringify(this._todoJson), this._todoPath)
.catch(print);
this._save();
this.emit('updated');
}
uncheck(index) {
this._todoJson[index].done = false;
Utils.writeFile(JSON.stringify(this._todoJson), this._todoPath)
.catch(print);
this._save();
this.emit('updated');
}