modified th api's for bin, contract and task to have as passed in as a prop and not get it ffrom the global state directly in the api

This commit is contained in:
csawatzky 2025-04-17 13:33:27 -06:00
parent 4bcac4e346
commit e2f5eb0557
31 changed files with 155 additions and 507 deletions

View file

@ -228,6 +228,7 @@ export default function BinVisualizer(props: Props) {
binPresets
} = props;
const binAPI = useBinAPI();
const [{as}] = useGlobalState()
const isMobile = useMobile();
const classes = useStyles();
const theme = useTheme();
@ -1814,7 +1815,7 @@ export default function BinVisualizer(props: Props) {
setModeTime(moment(newTimestamp));
status.lastModeChange = newTimestamp;
binAPI
.updateBinStatus(bin.key(), status)
.updateBinStatus(bin.key(), status, as)
.then(resp => {
openSnack("Reset the storage time");
})
@ -2066,7 +2067,7 @@ export default function BinVisualizer(props: Props) {
b.settings.outdoorHumidity = Number(outdoorHumidityInput);
b.settings.mode = newPreset;
binAPI.updateBin(bin.key(), b.settings).then(resp => {
binAPI.updateBin(bin.key(), b.settings, as).then(resp => {
refresh();
});
};