Use utility & fixup dependency array

This commit is contained in:
trevor-signal 2023-12-22 15:51:27 -05:00
parent ef67a98c20
commit 2ff0d87309
2 changed files with 19 additions and 17 deletions

View file

@ -14,7 +14,7 @@ import type { ContextMenuTriggerType } from '../components/conversation/MessageC
type KeyboardShortcutHandlerType = (ev: KeyboardEvent) => boolean;
function isCmdOrCtrl(ev: KeyboardEvent): boolean {
export function isCmdOrCtrl(ev: KeyboardEvent): boolean {
const { ctrlKey, metaKey } = ev;
const commandKey = get(window, 'platform') === 'darwin' && metaKey;
const controlKey = get(window, 'platform') !== 'darwin' && ctrlKey;