We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb44903 commit 01d4a95Copy full SHA for 01d4a95
src/whatsapp/controllers/instance.controller.ts
@@ -401,6 +401,12 @@ export class InstanceController {
401
402
public async logout({ instanceName }: InstanceDto) {
403
this.logger.verbose('requested logout from ' + instanceName + ' instance');
404
+ const stateConn = await this.connectionState({ instanceName });
405
+
406
+ if (stateConn.state === 'close') {
407
+ throw new BadRequestException('Instance already logged out');
408
+ }
409
410
try {
411
this.logger.verbose('logging out instance: ' + instanceName);
412
await this.waMonitor.waInstances[instanceName]?.client?.logout(
0 commit comments