refactoring

This commit is contained in:
mpetrov 2024-08-12 11:23:10 +03:00
parent bc35466e03
commit 647210b346

View File

@ -392,7 +392,9 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie
const title = `Delete connector \"${attribute.key}\"?`;
const content = `All connector data will be deleted.`;
this.dialogService.confirm(title, content, 'Cancel', 'Delete').pipe(take(1)).subscribe(result => {
this.dialogService.confirm(title, content, 'Cancel', 'Delete').pipe(
take(1),
switchMap((result) => {
if (!result) {
return;
}
@ -405,7 +407,9 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie
this.removeConnectorFromList(attribute.key, false);
tasks.push(this.getSaveEntityAttributesTask(scope));
forkJoin(tasks).pipe(take(1)).subscribe(() => {
return forkJoin(tasks);
})
).subscribe(() => {
if (this.initialConnector ? this.initialConnector.name === attribute.key : true) {
this.clearOutConnectorForm();
this.cd.detectChanges();
@ -413,7 +417,6 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie
}
this.updateData(true);
});
});
}
connectorLogs(attribute: AttributeData, $event: Event): void {