File tree Expand file tree Collapse file tree
src/api/integrations/chatbot/chatwoot/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -693,13 +693,13 @@ export class ChatwootService {
693693 } ) ) as any ;
694694 this . logger . verbose ( `Contact conversations: ${ JSON . stringify ( contactConversations ) } ` ) ;
695695
696- if ( ! contactConversations || ! contactConversations . payload ) {
696+ if ( ! contactConversations || ! contactConversations . payload || contactConversations . payload . length === 0 ) {
697697 this . logger . error ( 'No conversations found or payload is undefined' ) ;
698698 return null ;
699699 }
700700
701701 let inboxConversation = contactConversations . payload . find (
702- ( conversation ) => conversation . inbox_id == filterInbox . id ,
702+ ( conversation ) => conversation . inbox_id === filterInbox . id ,
703703 ) ;
704704 if ( inboxConversation ) {
705705 if ( this . provider . reopenConversation ) {
@@ -716,7 +716,7 @@ export class ChatwootService {
716716 }
717717 } else {
718718 inboxConversation = contactConversations . payload . find (
719- ( conversation ) => conversation . status !== 'resolved' && conversation . inbox_id == filterInbox . id ,
719+ ( conversation ) => conversation . status !== 'resolved' && conversation . inbox_id === filterInbox . id ,
720720 ) ;
721721 this . logger . verbose ( `Found conversation: ${ JSON . stringify ( inboxConversation ) } ` ) ;
722722 }
You can’t perform that action at this time.
0 commit comments