Skip to content

Commit f722de2

Browse files
committed
fix: handle empty to and from addresses in message meta,
- remove unncessary console log
1 parent 6b2be57 commit f722de2

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

frontend/src/features/conversation/ReplyBoxContent.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ const enableSend = computed(() => {
259259
* @param {string} field - 'to', 'cc', or 'bcc'
260260
*/
261261
const validateEmails = (field) => {
262-
console.log('Validating emails for field:', field)
263262
const emails = field === 'to' ? to.value : field === 'cc' ? cc.value : bcc.value
264263
const emailList = emails
265264
.split(',')
@@ -268,8 +267,6 @@ const validateEmails = (field) => {
268267
269268
const invalidEmails = emailList.filter((email) => !validateEmail(email))
270269
271-
console.log('Invalid emails:', invalidEmails)
272-
273270
// Clear existing errors
274271
emailErrors.value = []
275272

frontend/src/features/conversation/sidebar/CustomAttributes.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ const getValidationSchema = (attribute) => {
180180
// If regex is provided and valid, add it to the schema validation along with the hint
181181
if (attribute.regex) {
182182
try {
183-
console.log('Creating regex:', attribute.regex)
184183
const regex = new RegExp(attribute.regex)
185184
schema = schema.regex(regex, {
186185
message: attribute.regex_hint

frontend/src/stores/conversation.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,12 @@ export const useConversationStore = defineStore('conversation', () => {
262262
if (!conv || !msgData || !inboxEmail) return
263263

264264
const latestMessage = msgData.getLatestMessage(conv.uuid, ['incoming', 'outgoing'], true)
265+
if (!latestMessage) return
265266

266267
if (!["received", "sent"].includes(latestMessage.status)) {
267268
return
268269
}
269270

270-
if (!latestMessage) return
271-
272271
const { to, cc, bcc } = computeRecipientsFromMessage(
273272
latestMessage,
274273
conv.contact?.email || '',

frontend/src/utils/email-recipients.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ export function computeRecipientsFromMessage (message, contactEmail, inboxEmail)
44

55
// Build TO field
66
const toList = isIncoming
7-
? meta.from || []
7+
? meta.from && meta.from.length
8+
? meta.from
9+
: contactEmail
10+
? [contactEmail]
11+
: []
812
: meta.to && meta.to.length
913
? meta.to
1014
: contactEmail

0 commit comments

Comments
 (0)