chore(react/settings): reimplement reset shortcuts

This commit is contained in:
Elian Doran
2025-08-18 19:47:40 +03:00
parent 227cf5de85
commit b97a5ef888
4 changed files with 36 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
import { OptionNames } from "@triliumnext/commons";
import server from "./server.js";
import { isShare } from "./utils.js";
@@ -76,6 +77,10 @@ class Options {
await server.put(`options`, payload);
}
async saveMany<T extends OptionNames>(newValues: Record<T, OptionValue>) {
await server.put<void>("options", newValues);
}
async toggle(key: string) {
await this.save(key, (!this.is(key)).toString());
}