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

Force re-load of the event list when navigating out of it #211

Open
1 task
Simmanz opened this issue Dec 10, 2024 · 3 comments
Open
1 task

Force re-load of the event list when navigating out of it #211

Simmanz opened this issue Dec 10, 2024 · 3 comments
Assignees

Comments

@Simmanz
Copy link
Contributor

Simmanz commented Dec 10, 2024

Current state

After having loaded the event list in a park overview, going into another will display the previous park's event list. After a few seconds, it will change.

Objective

  • Make the event list updated when navigating out of park overview.
@Simmanz Simmanz self-assigned this Dec 10, 2024
@Simmanz
Copy link
Contributor Author

Simmanz commented Dec 10, 2024

This might be harder than originally planned because the navigation logic to navigate out of the parkOverview screen is defined in the topAppBar. I think that defining a callback could do the job, but I am not sure about clean ways to make this work yet.

@Simmanz
Copy link
Contributor Author

Simmanz commented Dec 10, 2024

What did not work

I set up a callback function (when exiting the parkOverview -> goBack() from navigationActions), it did :

  • Reseting the current park (null)
  • Emptying the ui state of the eventViewModel (Empty) to prevent the list from being wrongly displayed.

@Simmanz
Copy link
Contributor Author

Simmanz commented Dec 10, 2024

Overwriting directly the uiState inside the composable

This did make the event list be un-loaded (can see the changes just before the navigation exits the screen), but when loading a new parkOverview, the older event list (that got reset) is still being displayed at the start !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant