Add forward messages shortcut, remap open stickers
This commit is contained in:
parent
5773c7bc9a
commit
a7a058bb73
4 changed files with 37 additions and 2 deletions
|
@ -5307,6 +5307,10 @@
|
||||||
"messageformat": "Delete selected messages",
|
"messageformat": "Delete selected messages",
|
||||||
"description": "Shown in the shortcuts guide"
|
"description": "Shown in the shortcuts guide"
|
||||||
},
|
},
|
||||||
|
"icu:Keyboard--forward-messages": {
|
||||||
|
"messageformat": "Forward selected messages",
|
||||||
|
"description": "Shown in the shortcuts guide"
|
||||||
|
},
|
||||||
"Keyboard--add-newline": {
|
"Keyboard--add-newline": {
|
||||||
"message": "Add newline to message",
|
"message": "Add newline to message",
|
||||||
"description": "(deleted 03/29/2023) Shown in the shortcuts guide"
|
"description": "(deleted 03/29/2023) Shown in the shortcuts guide"
|
||||||
|
|
|
@ -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
|
// COMPOSER
|
||||||
|
|
||||||
// Create a newline in your message - handled by component
|
// Create a newline in your message - handled by component
|
||||||
|
|
|
@ -30,6 +30,7 @@ type KeyType =
|
||||||
| 'D'
|
| 'D'
|
||||||
| 'E'
|
| 'E'
|
||||||
| 'F'
|
| 'F'
|
||||||
|
| 'G'
|
||||||
| 'J'
|
| 'J'
|
||||||
| 'L'
|
| 'L'
|
||||||
| 'M'
|
| 'M'
|
||||||
|
@ -130,7 +131,7 @@ function getNavigationShortcuts(i18n: LocalizerType): Array<ShortcutType> {
|
||||||
{
|
{
|
||||||
id: 'Keyboard--open-sticker-chooser',
|
id: 'Keyboard--open-sticker-chooser',
|
||||||
description: i18n('icu: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',
|
id: 'Keyboard--begin-recording-voice-note',
|
||||||
|
@ -197,6 +198,11 @@ function getMessageShortcuts(i18n: LocalizerType): Array<ShortcutType> {
|
||||||
description: i18n('icu:Keyboard--delete-messages'),
|
description: i18n('icu:Keyboard--delete-messages'),
|
||||||
keys: [['commandOrCtrl', 'shift', 'D']],
|
keys: [['commandOrCtrl', 'shift', 'D']],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'Keyboard--forward-messages',
|
||||||
|
description: i18n('icu:Keyboard--forward-messages'),
|
||||||
|
keys: [['commandOrCtrl', 'shift', 'S']],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ export const StickerButton = React.memo(function StickerButtonInner({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commandOrCtrl && shiftKey && (key === 's' || key === 'S')) {
|
if (commandOrCtrl && shiftKey && (key === 'g' || key === 'G')) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue