fix for when there are no changes to the mode over the set period of time
This commit is contained in:
parent
44f227c3e9
commit
cf0d493f40
1 changed files with 15 additions and 1 deletions
|
|
@ -109,9 +109,9 @@ export default function BinLevelOverTime(props: Props) {
|
|||
})
|
||||
}
|
||||
});
|
||||
let currentTime = moment().valueOf();
|
||||
if (data.length === 0) {
|
||||
let bushels = bin.bushels();
|
||||
let currentTime = moment().valueOf();
|
||||
data.push({
|
||||
value: fertilizerBin
|
||||
? Math.round(bushels * 35.239)
|
||||
|
|
@ -121,6 +121,13 @@ export default function BinLevelOverTime(props: Props) {
|
|||
timestamp: currentTime
|
||||
});
|
||||
}
|
||||
if(modeData.length === 0){
|
||||
modeData.push({
|
||||
timestamp: currentTime,
|
||||
value: 1,
|
||||
fill: getFill(bin.settings.mode)
|
||||
})
|
||||
}
|
||||
setInventoryData(data);
|
||||
setModeData(modeData)
|
||||
})
|
||||
|
|
@ -206,6 +213,13 @@ export default function BinLevelOverTime(props: Props) {
|
|||
})
|
||||
}
|
||||
})
|
||||
if(modeData.length === 0){
|
||||
modeData.push({
|
||||
timestamp: moment().valueOf(),
|
||||
value: 1,
|
||||
fill: getFill(bin.settings.mode)
|
||||
})
|
||||
}
|
||||
setModeData(modeData)
|
||||
})
|
||||
.catch(err => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue