diff --git a/frontend/apps/main/src/features/conversation/ReplyBox.vue b/frontend/apps/main/src/features/conversation/ReplyBox.vue index 1e62de57..c6a6f728 100644 --- a/frontend/apps/main/src/features/conversation/ReplyBox.vue +++ b/frontend/apps/main/src/features/conversation/ReplyBox.vue @@ -13,7 +13,7 @@ {{ $t('globals.messages.cancel') }} - {{ + {{ $t('replyBox.sendAnyway') }} @@ -30,7 +30,7 @@ {{ $t('globals.messages.cancel') }} - {{ + {{ $t('replyBox.sendAnyway') }} @@ -249,6 +249,7 @@ const aiPrompts = computed(() => aiPromptStore.prompts) const replyBoxContentRef = ref(null) const showContactEmailWarning = ref(false) const showMissingTagsWarning = ref(false) +const deferredStatus = ref(null) const mentions = ref([]) aiPromptStore.fetchPrompts() @@ -307,10 +308,7 @@ const hasTextContent = computed(() => { return textContent.value.trim().length > 0 }) -/** - * Processes the send action. - */ -const processSend = async (skipContactEmailCheck = false, skipMissingTagsCheck = false) => { +const processSend = async (skipContactEmailCheck = false, skipMissingTagsCheck = false, statusToSet = null) => { let hasMessageSendingErrored = false isEditorFullscreen.value = false @@ -329,6 +327,7 @@ const processSend = async (skipContactEmailCheck = false, skipMissingTagsCheck = currentInbox?.prompt_tags_on_reply && !(conversationStore.current.tags?.length > 0) ) { + deferredStatus.value = statusToSet showMissingTagsWarning.value = true return } @@ -354,6 +353,7 @@ const processSend = async (skipContactEmailCheck = false, skipMissingTagsCheck = .map((e) => e.trim()) .includes(contactEmail) ) { + deferredStatus.value = statusToSet showContactEmailWarning.value = true return } @@ -464,23 +464,13 @@ const processSend = async (skipContactEmailCheck = false, skipMissingTagsCheck = clearMediaFiles() emailErrors.value = [] mentions.value = [] + if (statusToSet) conversationStore.updateStatus(statusToSet) } isSending.value = false - - // Return whether the message was sent successfully. return !hasMessageSendingErrored } -/** - * Processes the send action and update conversation status. - * The status is only updated if the message is sent successfully. - */ -const processSendAndSetStatus = async (status) => { - const success = await processSend() - if (success) { - conversationStore.updateStatus(status) - } -} +const processSendAndSetStatus = (status) => processSend(false, false, status) /** * Watches for changes in the conversation's macro id and update message content. diff --git a/frontend/apps/main/src/stores/conversation.js b/frontend/apps/main/src/stores/conversation.js index 1dd3727a..ba789803 100644 --- a/frontend/apps/main/src/stores/conversation.js +++ b/frontend/apps/main/src/stores/conversation.js @@ -40,7 +40,7 @@ export const useConversationStore = defineStore('conversation', () => { return statuses.value.map(s => ({ label: s.name, value: s.id })) }) const statusOptionsNoSnooze = computed(() => - statuses.value.filter(s => s.name !== 'Snoozed').map(s => ({ + statuses.value.filter(s => s.name !== CONVERSATION_DEFAULT_STATUSES.SNOOZED).map(s => ({ label: s.name, value: s.id }))