Fix remove keybind matching in notification history

This commit is contained in:
sima
2026-02-16 13:13:56 +08:00
parent 1dc00a1373
commit e5196284a5
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -102,8 +102,13 @@ QtObject {
}
function checkKey(event, settingName, settings) {
// Map simplified names to the actual setting property names
var propName = "key" + settingName.charAt(0).toUpperCase() + settingName.slice(1);
// Accept both simplified names ("remove") and full property names ("keyRemove")
// so callers are less error-prone.
var normalized = String(settingName || "");
if (!normalized)
return false;
var propName = normalized.startsWith("key") ? normalized : ("key" + normalized.charAt(0).toUpperCase() + normalized.slice(1));
var boundKeys = settings.data.general.keybinds[propName];
if (!boundKeys || boundKeys.length === 0)
return false;