Skip to content

Conversation

AxelBlaz3
Copy link
Contributor

Proposed Changes

  • Notify listeners only when needed. This should prevent the root widget MaterialApp from rebuilding and creating a new context.

Related Issues (if applicable)

Now the app shows the reason why the login failed to the user.

Why this happened?
There's a 'Consumer' at the top most widget (MaterialApp) which gets rebuild everytime during logout and login. We don't need to notify listeners and rebuild the MaterialApp widget when logging out (cleaning up old data) during login. By doing so, context is in place and dialog appears. If the whole MaterialApp rebuilds, the old context is gone and a new context is given to all the widgets, which is where the issue arises and the dialog uses old context (which doens't exist in the first place).

Signed-off-by: AxelBlaz3 <karthikgaddam4@gmail.com>
Signed-off-by: AxelBlaz3 <karthikgaddam4@gmail.com>
@rolandgeider
Copy link
Member

Thanks!

@rolandgeider rolandgeider merged commit 4c4e0bd into wger-project:master Oct 14, 2021
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

Successfully merging this pull request may close these issues.

2 participants