const devices = _.flatMap(hosts, (host) => {
return host.devices.map((device) => {
device.hostname = host.name;
- device.uid = device.device_id ? device.device_id : `${device.hostname}-${device.path}`;
+ device.uid = device.device_id
+ ? `${device.device_id}-${device.hostname}-${device.path}`
+ : `${device.hostname}-${device.path}`;
return device;
});
});
if (this.updateSelectionOnRefresh === 'never') {
return;
}
- const newSelected: any[] = [];
+ const newSelected = new Set();
this.selection.selected.forEach((selectedItem) => {
for (const row of this.data) {
if (selectedItem[this.identifier] === row[this.identifier]) {
- newSelected.push(row);
+ newSelected.add(row);
}
}
});
+ const newSelectedArray = Array.from(newSelected.values());
if (
this.updateSelectionOnRefresh === 'onChange' &&
- _.isEqual(this.selection.selected, newSelected)
+ _.isEqual(this.selection.selected, newSelectedArray)
) {
return;
}
- this.selection.selected = newSelected;
+ this.selection.selected = newSelectedArray;
this.onSelect(this.selection);
}