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

Fix navigate to contacts list when user is already signed-in #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

haashem
Copy link

@haashem haashem commented Sep 7, 2022

for the first time when user creates an account, the app navigates to contact list, but when you hot reload the app or run the app for second time, login page is displayed and by tapping on login button, app doesn't navigate to contacts list. because firebase authStausChange only called once user state changes. and because user is already signed-in, by tapping on login button state doesn't get updated.

by swapping the currentViewBasedOnAuthStatus and viewsBloc.currentView, the new stream created by merge, the last event will be CurrentView.contactsList not CurrentView.login. merged stream always emits the right value.

final Stream<CurrentView> currentView = Rx.merge([
      viewsBloc.currentView,
      currentViewBasedOnAuthStatus,
    ]);

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.

1 participant