some hotfixes for construction so that the url navigation is correct when clicking on a card and an undefined error when loading heater data

This commit is contained in:
csawatzky 2026-01-15 15:51:56 -06:00
parent d9bcd07c8d
commit 4342e1f27b
4 changed files with 7 additions and 12 deletions

View file

@ -109,7 +109,7 @@ export default function ObjectHeaterCard(props: Props) {
});
}
}
if (heaterData.devices[0]) {
if (heaterData.devices && heaterData.devices[0]) {
setConnectedDevice(Device.any(heaterData.devices[0].device));
heaterData.devices[0].components.forEach(c => {
//loop through the components and assign them accordingly
@ -171,7 +171,7 @@ export default function ObjectHeaterCard(props: Props) {
const goToHeater = () => {
//history.push("/objectHeaters/" + heater.key);
let path = "/objectHeaters/" + heater.key;
let path = "/heaters/" + heater.key;
navigate(path, { state: {heater: heater} });
};