bcgov / bcwild

Wildlife Datacapture App
Apache License 2.0
1 stars 1 forks source link

[BCGOVWILD 96] [Bridges list][Animals list] The Bridge/Animal isn't displayed in the list right after its creation. #27

Closed stanislav-kondratev-dsr-corporation closed 1 year ago

stanislav-kondratev-dsr-corporation commented 1 year ago

Problem reason: Navigaton does not destroy the screens, so the internal state of the lists is preserved. For example, if the user creates a bridge and goes back to the Bridge List, the Bridge List still displayes outdated list of bridges stored in its local state.

Detected in the branch: main

Conditions to reproduce the issue: Go to the Bridge List, add a bridge and go back to the Bridge List. The newly created bridge does not appear in the list. Same for editing the name of the bridge. Same for Animal List.

Possible workarounds without the fix: Go to Dashboad and return to the Bridge List; the updated list is displayed.

Changes: Use the isFocused hook and destroy the stateful component when the Bridge List looses focus. Thus, the state is reinitialized when the user is back. Same for animals.

Risk factors: Bridge List, Bridge Form, Animal List, Animal Form.

Risk: Medium.

Recommendations for QA: Please make sure that the fix works properly on iOS.