mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-25 22:57:44 -06:00
fix error after logout and try to get status or to connect again
This commit is contained in:
@@ -75,11 +75,13 @@ export class ChatController {
|
||||
return await this.waMonitor.waInstances[instanceName].updatePrivacySettings(data);
|
||||
}
|
||||
|
||||
public async getBusinessProfile(
|
||||
public async fetchBusinessProfile(
|
||||
{ instanceName }: InstanceDto,
|
||||
data: ProfilePictureDto,
|
||||
) {
|
||||
return await this.waMonitor.waInstances[instanceName].getBusinessProfile(data.number);
|
||||
return await this.waMonitor.waInstances[instanceName].fetchBusinessProfile(
|
||||
data.number,
|
||||
);
|
||||
}
|
||||
|
||||
public async updateProfileName({ instanceName }: InstanceDto, data: ProfileNameDto) {
|
||||
|
||||
@@ -100,7 +100,7 @@ export class InstanceController {
|
||||
public async connectToWhatsapp({ instanceName }: InstanceDto) {
|
||||
try {
|
||||
const instance = this.waMonitor.waInstances[instanceName];
|
||||
const state = instance.connectionStatus?.state;
|
||||
const state = instance?.connectionStatus?.state ?? null;
|
||||
|
||||
switch (state) {
|
||||
case 'close':
|
||||
@@ -118,7 +118,7 @@ export class InstanceController {
|
||||
}
|
||||
|
||||
public async connectionState({ instanceName }: InstanceDto) {
|
||||
return this.waMonitor.waInstances[instanceName].connectionStatus;
|
||||
return this.waMonitor.waInstances[instanceName]?.connectionStatus;
|
||||
}
|
||||
|
||||
public async fetchInstances({ instanceName }: InstanceDto) {
|
||||
|
||||
Reference in New Issue
Block a user