Fix saving presets after deletion of the same name
This commit is contained in:
parent
d629d96d05
commit
a91f0f7ee5
|
@ -323,7 +323,7 @@ class PresetManager {
|
|||
}
|
||||
|
||||
async deleteCurrentPreset() {
|
||||
const { preset_names } = this.getPresetList();
|
||||
const { preset_names, presets } = this.getPresetList();
|
||||
const value = this.getSelectedPreset();
|
||||
const nameToDelete = this.getSelectedPresetName();
|
||||
|
||||
|
@ -335,7 +335,9 @@ class PresetManager {
|
|||
$(this.select).find(`option[value="${value}"]`).remove();
|
||||
|
||||
if (this.isKeyedApi()) {
|
||||
preset_names.splice(preset_names.indexOf(value), 1);
|
||||
const index = preset_names.indexOf(nameToDelete);
|
||||
preset_names.splice(index, 1);
|
||||
presets.splice(index, 1);
|
||||
} else {
|
||||
delete preset_names[nameToDelete];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue