From ee55e8e8ffcaf1789d78487d78910c0f2f9ab92e Mon Sep 17 00:00:00 2001 From: iamsivin Date: Thu, 21 Nov 2024 10:58:09 +0530 Subject: [PATCH] chore: Minor fix --- .../components/ActionButtons.vue | 38 ++++++++++++++++--- .../dashboard/i18n/locale/en/contact.json | 2 +- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue b/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue index f0d0bc870..34a1ce837 100644 --- a/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue +++ b/app/javascript/dashboard/components-next/NewConversation/components/ActionButtons.vue @@ -76,8 +76,11 @@ const EmojiInput = defineAsyncComponent( const messageSignature = useMapGetter('getMessageSignature'); const signatureToApply = computed(() => messageSignature.value); -const { fetchSignatureFlagFromUISettings, setSignatureFlagForInbox } = - useUISettings(); +const { + fetchSignatureFlagFromUISettings, + setSignatureFlagForInbox, + isEditorHotKeyEnabled, +} = useUISettings(); const sendWithSignature = computed(() => { return fetchSignatureFlagFromUISettings(props.channelType); @@ -125,10 +128,35 @@ const { onFileUpload } = useFileUpload({ }, }); +const sendButtonLabel = computed(() => { + const keyCode = isEditorHotKeyEnabled('cmd_enter') ? '⌘ + ↵' : '↵'; + return t('COMPOSE_NEW_CONVERSATION.FORM.ACTION_BUTTONS.SEND', { + keyCode, + }); +}); + const keyboardEvents = { Enter: { - action: () => - !props.isWhatsappInbox && !props.isDropdownActive && emit('sendMessage'), + action: () => { + if ( + isEditorHotKeyEnabled('enter') && + !props.isWhatsappInbox && + !props.isDropdownActive + ) { + emit('sendMessage'); + } + }, + }, + '$mod+Enter': { + action: () => { + if ( + isEditorHotKeyEnabled('cmd_enter') && + !props.isWhatsappInbox && + !props.isDropdownActive + ) { + emit('sendMessage'); + } + }, }, }; useKeyboardEvents(keyboardEvents); @@ -205,7 +233,7 @@ useKeyboardEvents(keyboardEvents); />