From 831e95b313844583a3dfdf8d75d44b2f9c5d6447 Mon Sep 17 00:00:00 2001 From: Maksym Tsymbarov Date: Tue, 16 Dec 2025 16:08:05 +0200 Subject: [PATCH] Fixed button changing after dialog closing --- .../lwm2m/lwm2m-bootstrap-config-servers.component.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-bootstrap-config-servers.component.ts b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-bootstrap-config-servers.component.ts index 86f01e4cd8..f988d7e6aa 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-bootstrap-config-servers.component.ts +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-bootstrap-config-servers.component.ts @@ -30,7 +30,7 @@ import { TranslateService } from '@ngx-translate/core'; import { DialogService } from '@core/services/dialog.service'; import { MatDialog } from '@angular/material/dialog'; import { Lwm2mBootstrapAddConfigServerDialogComponent } from '@home/components/profile/device/lwm2m/lwm2m-bootstrap-add-config-server-dialog.component'; -import { mergeMap, takeUntil } from 'rxjs/operators'; +import { filter, mergeMap, takeUntil } from 'rxjs/operators'; import { DeviceProfileService } from '@core/http/device-profile.service'; import { Lwm2mSecurityType } from '@shared/models/lwm2m-security-config.models'; @@ -164,10 +164,8 @@ export class Lwm2mBootstrapConfigServersComponent implements OnInit, ControlValu panelClass: ['tb-dialog', 'tb-fullscreen-dialog'] }).afterClosed(); const addServerConfigObs = addDialogObs.pipe( + filter((isBootstrap) => isBootstrap !== null), mergeMap((isBootstrap) => { - if (isBootstrap === null) { - return of(null); - } return this.deviceProfileService.getLwm2mBootstrapSecurityInfoBySecurityType(isBootstrap, Lwm2mSecurityType.NO_SEC); }) );