mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-25 14:47:45 -06:00
fix: When conversation reopens is pending when conversation pending is true
This commit is contained in:
@@ -507,6 +507,16 @@ export class ChatwootService {
|
||||
let conversation: any;
|
||||
if (this.provider.reopen_conversation) {
|
||||
conversation = contactConversations.payload.find((conversation) => conversation.inbox_id == filterInbox.id);
|
||||
|
||||
if (this.provider.conversation_pending) {
|
||||
await client.conversations.toggleStatus({
|
||||
accountId: this.provider.account_id,
|
||||
conversationId: conversation.id,
|
||||
data: {
|
||||
status: 'pending',
|
||||
},
|
||||
});
|
||||
}
|
||||
} else {
|
||||
conversation = contactConversations.payload.find(
|
||||
(conversation) => conversation.status !== 'resolved' && conversation.inbox_id == filterInbox.id,
|
||||
|
||||
@@ -695,7 +695,7 @@ export class WAStartupService {
|
||||
this.logger.verbose('Sending data to webhook in event STATUS_INSTANCE');
|
||||
this.sendDataWebhook(Events.STATUS_INSTANCE, {
|
||||
instance: this.instance.name,
|
||||
status: 'removed',
|
||||
status: 'closed',
|
||||
});
|
||||
|
||||
if (this.localChatwoot.enabled) {
|
||||
@@ -704,7 +704,7 @@ export class WAStartupService {
|
||||
{ instanceName: this.instance.name },
|
||||
{
|
||||
instance: this.instance.name,
|
||||
status: 'removed',
|
||||
status: 'closed',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user