TJRawlins / IrrigationManagerReact

Frontend irrigation management system (React TS)
1 stars 0 forks source link

BUG: React - PlantBar clears gallon totals on browser refresh #14

Closed TJRawlins closed 6 months ago

TJRawlins commented 7 months ago

When in PlantPage, refreshing page will clear out the gallon totals in the PlantBar. Need to find a way to persist state with either local storage or lifting state up

TJRawlins commented 6 months ago

Added local storage to redux to save both zone and zones to local storage. Created an updateLocalStorageZone function in ZoneCard component, passed it down to AddPlants, then added it to the end of the createPlant axios call in AddPlants. Now the PlantBar component will have the most current version of the zone and it's gallon totals. It will also persist after browser refresh.