#3982 CC: Fix visual duplication of presets on renaming

This commit is contained in:
Cohee
2025-05-24 00:01:50 +03:00
parent 6a67e54ff8
commit 1f7c65b45a

View File

@ -696,13 +696,14 @@ class PresetManager {
return;
}
$(this.select).find(`option[value="${value}"]`).remove();
if (this.isKeyedApi()) {
$(this.select).find(`option[value="${value}"]`).remove();
const index = preset_names.indexOf(nameToDelete);
preset_names.splice(index, 1);
presets.splice(index, 1);
} else {
const index = preset_names[nameToDelete];
$(this.select).find(`option[value="${index}"]`).remove();
delete preset_names[nameToDelete];
}