Commit 194200da49d08cf4ad3d370716d8b969df4fe6e1
Committed by
Andrew Shvayka
1 parent
bd558ed4
UI: LwM2M device profile resource fixed disabled observe checkbox
Showing
1 changed file
with
8 additions
and
6 deletions
@@ -164,12 +164,14 @@ export class Lwm2mObserveAttrTelemetryResourcesComponent implements ControlValue | @@ -164,12 +164,14 @@ export class Lwm2mObserveAttrTelemetryResourcesComponent implements ControlValue | ||
164 | form.get('attribute').valueChanges.pipe(startWith(resource.attribute), takeUntil(this.destroy$)), | 164 | form.get('attribute').valueChanges.pipe(startWith(resource.attribute), takeUntil(this.destroy$)), |
165 | form.get('telemetry').valueChanges.pipe(startWith(resource.telemetry), takeUntil(this.destroy$)) | 165 | form.get('telemetry').valueChanges.pipe(startWith(resource.telemetry), takeUntil(this.destroy$)) |
166 | ]).subscribe(([attribute, telemetry]) => { | 166 | ]).subscribe(([attribute, telemetry]) => { |
167 | - if (attribute || telemetry) { | ||
168 | - form.get('observe').enable({emitEvent: false}); | ||
169 | - } else { | ||
170 | - form.get('observe').disable({emitEvent: false}); | ||
171 | - form.get('observe').patchValue(false, {emitEvent: false}); | ||
172 | - form.get('attributes').patchValue({}, {emitEvent: false}); | 167 | + if (!this.disabled) { |
168 | + if (attribute || telemetry) { | ||
169 | + form.get('observe').enable({emitEvent: false}); | ||
170 | + } else { | ||
171 | + form.get('observe').disable({emitEvent: false}); | ||
172 | + form.get('observe').patchValue(false, {emitEvent: false}); | ||
173 | + form.get('attributes').patchValue({}, {emitEvent: false}); | ||
174 | + } | ||
173 | } | 175 | } |
174 | }); | 176 | }); |
175 | return form; | 177 | return form; |