add empty sync api to clean up use

This commit is contained in:
Stewart Allen 2024-05-16 18:53:38 -04:00
commit 2a21f1aca2
3 changed files with 14 additions and 5 deletions

View file

@ -1393,11 +1393,11 @@ gapp.register("kiri.init", [], (root, exports) => {
}
async function sync_get() {
api.settings.sync && await api.settings.sync.get();
await api.settings.sync.get();
}
async function sync_put() {
api.settings.sync && await api.settings.sync.put();
await api.settings.sync.put();
}
function showDevices() {

View file

@ -697,6 +697,7 @@ gapp.register("kiri.main", [], (root, exports) => {
api.conf.load(null, name);
}
api.conf.save();
api.settings.sync.put();
} catch (e) {
UC.alert('malformed settings object');
}
@ -726,6 +727,7 @@ gapp.register("kiri.main", [], (root, exports) => {
let current = settings.get();
let name = e.target.getAttribute("del");
delete current.sproc[getMode()][name];
api.settings.sync.put();
updateProcessList();
api.conf.save();
triggerSettingsEvent();

View file

@ -83,9 +83,11 @@ function loadSettings(evt, named) {
}
function showSettings() {
api.dialog.update_process_list();
api.modal.show("saves");
api.ui.settingsName.focus();
api.settings.sync.get().then(() => {
api.dialog.update_process_list();
api.modal.show("saves");
api.ui.settingsName.focus();
});
}
function updateSettings(opt = {}) {
@ -760,6 +762,11 @@ api.settings = {
ctrl() { return settings.controller },
mode() { return settings.mode },
prof() { return settings.sproc[settings.mode] },
sync: {
async get() {},
async put() {},
status: false
}
};
});