mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-04 16:14:07 +00:00
fix: name the account sign out leaves in the command palette, add star, hide dead key hints
This commit is contained in:
@@ -10,3 +10,12 @@ import { useSettingsStore } from "@/stores/settings-store";
|
||||
export function isSingleKeyShortcutOff(event: Pick<KeyboardEvent, "key" | "ctrlKey" | "metaKey" | "altKey">): boolean {
|
||||
return isSingleCharacterKey(event) && useSettingsStore.getState().singleKeyShortcuts === false;
|
||||
}
|
||||
|
||||
/**
|
||||
* A key hint as the help and menus write it ("r", "Shift + I", "#") that's a single-key
|
||||
* shortcut, so it does nothing while those are off. Arrows aren't characters.
|
||||
*/
|
||||
export function isSingleKeyHint(combo: string): boolean {
|
||||
const key = combo.replace(/^(shift\s*\+\s*)+/i, "").trim();
|
||||
return [...key].length === 1 && !/[←→↑↓]/.test(key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user