mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-18 19:32:21 -06:00
fix: chatwoot screen
This commit is contained in:
@@ -118,13 +118,17 @@ export class WAMonitoringService {
|
||||
public async cleaningUp(instanceName: string) {
|
||||
let instanceDbId: string;
|
||||
if (this.db.SAVE_DATA.INSTANCE) {
|
||||
const findInstance = await this.prismaRepository.instance.findFirst({
|
||||
where: { name: instanceName },
|
||||
});
|
||||
|
||||
if (!findInstance) this.logger.error('Instance not found');
|
||||
|
||||
const instance = await this.prismaRepository.instance.update({
|
||||
where: { name: instanceName },
|
||||
data: { connectionStatus: 'close' },
|
||||
});
|
||||
|
||||
if (!instance) this.logger.error('Instance not found');
|
||||
|
||||
rmSync(join(INSTANCE_DIR, instance.id), { recursive: true, force: true });
|
||||
|
||||
instanceDbId = instance.id;
|
||||
@@ -150,6 +154,8 @@ export class WAMonitoringService {
|
||||
where: { name: instanceName },
|
||||
});
|
||||
|
||||
if (!instance) return;
|
||||
|
||||
rmSync(join(INSTANCE_DIR, instance.id), { recursive: true, force: true });
|
||||
|
||||
await this.prismaRepository.session.deleteMany({ where: { sessionId: instance.id } });
|
||||
@@ -194,7 +200,8 @@ export class WAMonitoringService {
|
||||
data: {
|
||||
id: data.instanceId,
|
||||
name: data.instanceName,
|
||||
connectionStatus: data.integration && data.integration === Integration.WHATSAPP_BAILEYS ? 'close' : 'open',
|
||||
connectionStatus:
|
||||
data.integration && data.integration === Integration.WHATSAPP_BAILEYS ? 'close' : data.status ?? 'open',
|
||||
number: data.number,
|
||||
integration: data.integration || Integration.WHATSAPP_BAILEYS,
|
||||
token: data.hash,
|
||||
@@ -226,6 +233,8 @@ export class WAMonitoringService {
|
||||
providerFiles: this.providerFiles,
|
||||
});
|
||||
|
||||
if (!instance) return;
|
||||
|
||||
instance.setInstance({
|
||||
instanceId: instanceData.instanceId,
|
||||
instanceName: instanceData.instanceName,
|
||||
|
||||
Reference in New Issue
Block a user