fixed preset updating not working properly

This commit is contained in:
Jack 2021-05-08 20:26:44 +01:00
parent 6ca613510a
commit 2ad85778e2

View file

@ -105,15 +105,17 @@ function apply() {
uid: firebase.auth().currentUser.uid,
name: inputVal,
presetid,
config: preset.config,
config: configChanges,
}).then((e) => {
Loader.hide();
let status = e.data.resultCode;
if (status === 1) {
Notifications.add("Preset updated", 1);
DB.getSnapshot().presets.filter(
let preset = DB.getSnapshot().presets.filter(
(preset) => preset.id == presetid
)[0].name = inputVal;
)[0];
preset.name = inputVal;
preset.config = configChanges;
Settings.update();
} else if (status === -1) {
Notifications.add("Invalid preset name", 0);