You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when the app is opened with an unsaved draft observation, we dynamically change the initialRoute of the RootNavigator to show the observation edit screen, or the preset chooser screen. The consequence of this is that we have no screens in the stack in this state, where-as at other times we aways have the hometabs screen at the the base of the stack, so closing the edit observation screen is more complicated, and has to reset the whole stack.
We should change the architecture of this so that homeTabs is always mounted, and address the case of an unsaved draft observation by redirecting as a side-effect during render of either the root navigator, or render of the homeTabs screen.
We need to ensure that this side-effect does not run during use of the app (e.g. when the user starts editing an observation). We can do this by only running the side effect on mount (fragile), or doing some other check before navigating.
We should also change the hooks that is checking a draft observation exists so that it does not re-render every time we edit the draft observation.
After changing this, we can remove the code that resets the navigation stack when saving / closing the edit observation screen.
The text was updated successfully, but these errors were encountered:
Currently when the app is opened with an unsaved draft observation, we dynamically change the initialRoute of the RootNavigator to show the observation edit screen, or the preset chooser screen. The consequence of this is that we have no screens in the stack in this state, where-as at other times we aways have the hometabs screen at the the base of the stack, so closing the edit observation screen is more complicated, and has to reset the whole stack.
We should change the architecture of this so that homeTabs is always mounted, and address the case of an unsaved draft observation by redirecting as a side-effect during render of either the root navigator, or render of the homeTabs screen.
We need to ensure that this side-effect does not run during use of the app (e.g. when the user starts editing an observation). We can do this by only running the side effect on mount (fragile), or doing some other check before navigating.
We should also change the hooks that is checking a draft observation exists so that it does not re-render every time we edit the draft observation.
After changing this, we can remove the code that resets the navigation stack when saving / closing the edit observation screen.
The text was updated successfully, but these errors were encountered: