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 the next button disable issue after visiting homeserver screen #8087

Conversation

ByeongsuPark
Copy link
Contributor

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Fix the next button disabled issue after going to change homeserver screen.
The initial emission of flow is an empty string when coming back after visiting homeserver screen.
Because at that time(onViewCreated) the view's state is not restored yet.
Collecting flow after onViewStateRestored can be the one way to solve this problem.
So flowWithLifecycle() is added to collect flow after onViewStateRestored is called.

Motivation and context

Fix #7928

Screenshots / GIFs

Before After
default.mp4
default.mp4
-->

Tests

Same steps as mentioned in the issue #7928

Tested devices

  • Physical
  • OS version(s): API 33
  • Emulator
  • OS version(s): API 21

Checklist

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@@ -103,7 +104,7 @@ class FtueAuthCombinedLoginFragment :

combine(views.loginInput.editText().textChanges(), views.loginPasswordInput.editText().textChanges()) { account, password ->
views.loginSubmit.isEnabled = account.isNotEmpty() && password.isNotEmpty()
}.launchIn(viewLifecycleOwner.lifecycleScope)
}.flowWithLifecycle(lifecycle).launchIn(viewLifecycleOwner.lifecycleScope)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

@bmarty bmarty merged commit f8283e4 into element-hq:develop Feb 7, 2023
@bmarty bmarty added the Z-Community-PR Issue is solved by a community member's PR label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Next button is disabled after going to change homeserver screen.
2 participants