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(dashpay): username request voting period bugs #1318

Open
wants to merge 2 commits into
base: dashpay-voting
Choose a base branch
from

Conversation

HashEngineering
Copy link
Collaborator

Issue being fixed or feature implemented

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

@HashEngineering HashEngineering self-assigned this Oct 29, 2024
@HashEngineering HashEngineering changed the base branch from master to dashpay-voting October 29, 2024 20:06
Copy link
Member

@Syn-McJ Syn-McJ left a comment

Choose a reason for hiding this comment

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

Looks good. Some coroutine improvements can be made

@@ -247,7 +253,7 @@ class RequestUserNameViewModel @Inject constructor(
}

fun checkUsername(requestedUserName: String?) {
viewModelScope.launch {
viewModelScope.launch(Dispatchers.IO) {
Copy link
Member

Choose a reason for hiding this comment

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

In general, it's better not to dispatch coroutines in IO scope at the top level, but go down to where the actual work is done and call it inside withContext(Dispatchers.IO) so that the top-level callers don't have to worry about threading, correct context and switching back to the main thread to update UI.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks for this idea.

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