Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selected item in the drawer defaults to wrong item #15

Open
3 tasks done
muffix opened this issue Dec 31, 2022 · 0 comments
Open
3 tasks done

Selected item in the drawer defaults to wrong item #15

muffix opened this issue Dec 31, 2022 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@muffix
Copy link
Owner

muffix commented Dec 31, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Happening on the latest app version?

  • I have seen this on the latest version of the app

This is not a data update request

  • I am not requesting a data update

Explain what you did

I restarted the app after previously navigating to a screen other than Map.

Describe the bug

The navigation drawer is highlighting the wrong screen. This is because we're persisting the state to storage:

case ActionKind.DrawerItemSelected: {
newState.uiState.screenName = action.payload.screenName;
return newState;
}

When restarting the app, we are restoring the state for the navigation, but aren't respecting it for the content. We should do one of the following:

  • remove the last selected screen from the persisted state and keep it only for as long as the app is running; meaning the app will always start on the Map screen
  • restore the state fully and start on the last selected screen

Expected behaviour

The navigation drawer should highlight the correct item for the screen shown.

Steps to reproduce

1. Start the app
2. Navigate to any screen other than Map
3. Force-close the app
4. Reopen the app
5. Open the navigation drawer
6. Observe that the app starts on the Map screen, but the previously selected screen is highlighted in the navigation.

Your device and OS

Affects all devices, e.g. iPhone 12 Pro, iOS 16.2

Screenshots

image

@muffix muffix added Needs triage Newly submitted issues bug Something isn't working good first issue Good for newcomers and removed Needs triage Newly submitted issues labels Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant