From fea6cf3a115c1a90bec48b38b97cda1f029099e8 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 18 Sep 2022 09:39:07 +0800 Subject: [PATCH] :bug: update Hotkey --- app/src/protyle/util/compatibility.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.ts index 30c2c04dd..c992e506d 100644 --- a/app/src/protyle/util/compatibility.ts +++ b/app/src/protyle/util/compatibility.ts @@ -99,7 +99,8 @@ export const updateHotkeyTip = (hotkey: string) => { if (hotkey.indexOf("⇧") > -1) keys.push(KEY_MAP.get("⇧")); if (hotkey.indexOf("⌥") > -1) keys.push(KEY_MAP.get("⌥")); - const lastKey = hotkey.charAt(hotkey.length - 1); + // 不能去最后一个,需匹配 F2 + const lastKey = hotkey.replace(/⌘|⇧|⌥/g, ""); if ("⌘⇧⌥".indexOf(lastKey) < 0) { keys.push( KEY_MAP.get(lastKey)