Add forward messages shortcut, remap open stickers

This commit is contained in:
Jamie Kyle 2023-04-05 18:04:41 -07:00 committed by GitHub
parent 5773c7bc9a
commit a7a058bb73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 2 deletions

View file

@ -5307,6 +5307,10 @@
"messageformat": "Delete selected messages",
"description": "Shown in the shortcuts guide"
},
"icu:Keyboard--forward-messages": {
"messageformat": "Forward selected messages",
"description": "Shown in the shortcuts guide"
},
"Keyboard--add-newline": {
"message": "Add newline to message",
"description": "(deleted 03/29/2023) Shown in the shortcuts guide"

View file

@ -1753,6 +1753,31 @@ export async function startApp(): Promise<void> {
}
}
if (
conversation &&
commandOrCtrl &&
shiftKey &&
(key === 's' || key === 'S')
) {
const { hasConfirmationModal } = state.globalModals;
const { targetedMessage, selectedMessageIds } = state.conversations;
const messageIds =
selectedMessageIds ??
(targetedMessage != null ? [targetedMessage] : null);
if (!hasConfirmationModal && messageIds != null) {
event.preventDefault();
event.stopPropagation();
window.reduxActions.globalModals.toggleForwardMessagesModal(
messageIds
);
return;
}
}
// COMPOSER
// Create a newline in your message - handled by component

View file

@ -30,6 +30,7 @@ type KeyType =
| 'D'
| 'E'
| 'F'
| 'G'
| 'J'
| 'L'
| 'M'
@ -130,7 +131,7 @@ function getNavigationShortcuts(i18n: LocalizerType): Array<ShortcutType> {
{
id: 'Keyboard--open-sticker-chooser',
description: i18n('icu:Keyboard--open-sticker-chooser'),
keys: [['commandOrCtrl', 'shift', 'S']],
keys: [['commandOrCtrl', 'shift', 'G']],
},
{
id: 'Keyboard--begin-recording-voice-note',
@ -197,6 +198,11 @@ function getMessageShortcuts(i18n: LocalizerType): Array<ShortcutType> {
description: i18n('icu:Keyboard--delete-messages'),
keys: [['commandOrCtrl', 'shift', 'D']],
},
{
id: 'Keyboard--forward-messages',
description: i18n('icu:Keyboard--forward-messages'),
keys: [['commandOrCtrl', 'shift', 'S']],
},
];
}

View file

@ -201,7 +201,7 @@ export const StickerButton = React.memo(function StickerButtonInner({
return;
}
if (commandOrCtrl && shiftKey && (key === 's' || key === 'S')) {
if (commandOrCtrl && shiftKey && (key === 'g' || key === 'G')) {
event.stopPropagation();
event.preventDefault();