From 1f7c65b45a1f804e1bb891dde90c1aeeff7d3722 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 24 May 2025 00:01:50 +0300 Subject: [PATCH] #3982 CC: Fix visual duplication of presets on renaming --- public/scripts/preset-manager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/scripts/preset-manager.js b/public/scripts/preset-manager.js index 981855704..eaffec2d2 100644 --- a/public/scripts/preset-manager.js +++ b/public/scripts/preset-manager.js @@ -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]; }