mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 13:27:49 +08:00
fixed preset updating not working properly
This commit is contained in:
parent
6ca613510a
commit
2ad85778e2
1 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue