Browse Source

fix(iot-hub): load installed devices when activeType input is set

When the browse component is used on /iot-hub/devices (via items page
component), the parent sets config in its own ngOnInit, so the child's
@Input setter fires AFTER the child's ngOnInit. The DEVICE-specific
loading (vendors + installed items) in ngOnInit never executed because
activeType was still the default WIDGET at that point.

Fix: trigger loading directly in the activeType setter when the value
changes to DEVICE.
pull/15508/head
Andrii Shvaika 6 months ago
parent
commit
c505301330
  1. 4
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts

4
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts

@ -70,6 +70,10 @@ export class TbIotHubBrowseComponent implements OnInit, OnDestroy {
@Input() set activeType(value: ItemType) {
if (value && value !== this._activeType) {
this._activeType = value;
if (value === ItemType.DEVICE) {
this.loadVendors();
this.loadInstalledDevices();
}
}
}
get activeType(): ItemType {

Loading…
Cancel
Save