Skip to content

Commit

Permalink
Fix "Insert Text" keyboard shortcut (#1118)
Browse files Browse the repository at this point in the history
  • Loading branch information
aude authored and sindresorhus committed Oct 19, 2019
1 parent a8c8282 commit 343705e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Jump to conversation | <kbd>Command/Control</kbd> <kbd>1</kbd>…<kbd>9</kbd>
Insert GIF | <kbd>Command/Control</kbd> <kbd>g</kbd>
Insert sticker | <kbd>Command/Control</kbd> <kbd>s</kbd>
Insert emoji | <kbd>Command/Control</kbd> <kbd>e</kbd>
Insert text | <kbd>Command/Control</kbd> <kbd>i</kbd>
Focus text input | <kbd>Command/Control</kbd> <kbd>i</kbd>
Search in conversation | <kbd>Command/Control</kbd> <kbd>f</kbd>
Mute conversation | <kbd>Command/Control</kbd> <kbd>Shift</kbd> <kbd>m</kbd>
Archive conversation | <kbd>Command/Control</kbd> <kbd>Shift</kbd> <kbd>a</kbd>
Expand Down
4 changes: 2 additions & 2 deletions source/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ ipc.on('insert-sticker', () => {
stickerElement!.click();
});

ipc.on('insert-text', () => {
document.querySelector<HTMLElement>('._5rpu')!.focus();
ipc.on('focus-text-input', () => {
document.querySelector<HTMLElement>('._7kpg ._5rpu')!.focus();
});

ipc.on('next-conversation', nextConversation);
Expand Down
4 changes: 2 additions & 2 deletions source/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,10 @@ Press Command/Ctrl+R in Caprine to see your changes.
}
},
{
label: 'Insert Text',
label: 'Focus Text Input',
accelerator: 'CommandOrControl+I',
click() {
sendAction('insert-text');
sendAction('focus-text-input');
}
}
];
Expand Down

0 comments on commit 343705e

Please sign in to comment.