Open History to see the last commit
1interface CommentSubmitShortcutEvent {
2 readonly key: string;
3 readonly metaKey: boolean;
4 readonly ctrlKey: boolean;
5}
6
7export function isCommentSubmitShortcut(
8 event: CommentSubmitShortcutEvent,
9 value: string,
10 pending: boolean,
11): boolean {
12 return (
13 !pending && (event.metaKey || event.ctrlKey) && event.key === "Enter" && value.trim().length > 0
14 );
15}