fix(whatsapp.gblib): Fixed check status.

This commit is contained in:
Rodrigo Rodriguez 2025-01-27 10:49:57 -03:00
parent fb5aeca78c
commit 8028c821cb
2 changed files with 8 additions and 2 deletions

View file

@ -243,14 +243,14 @@ export class NewUserDialog extends IGBDialog {
min,
botName,
'999999999',
'email@doman.cloud',
'email@domain.cloud',
'5521999998888',
botName,
null,
'12',
'99',
'1234',
'Starter.gbai',
'crawlergbot.gbai',
true
);

View file

@ -258,6 +258,9 @@ export class WhatsappDirectLine extends GBService {
return state === 'CONNECTED';
default:
if (this.whatsappServiceUrl){
GBLog.verbose(`GBWhatsapp: Checking server...`);
let url = urlJoin(this.whatsappServiceUrl, 'status') + `?token=${this.min.instance.whatsappServiceKey}`;
const options = {
@ -268,6 +271,9 @@ export class WhatsappDirectLine extends GBService {
const res = await fetch(url, options);
const json = await res.json();
return json['accountStatus'] === 'authenticated';
}
return true;
}
}