TJRawlins / IrrigationManagerReact

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

React - Create permanent fix for Zone edit bug #19

Open TJRawlins opened 6 months ago

TJRawlins commented 6 months ago

Issue: When clicking on zone edit button, component renders twice. The first render, it pulls the previous zone from local storage. The second render pulls the correct current zone. Since the modal appears instantly, it populates the fields with the previous zone from the first render only. This issue started after adding local storage to redux for state persistence to fix the plant bar total gallons bug.

Temporary fix: Added a setTimeout to the showEdit function, causing the edit modal to only pick up the correct current zone on the second render and ignoring the previous zone on the first render.