chore: remove redundant Dispatchers.Main from viewModelScope.launch#1255
Open
evanofficial wants to merge 1 commit intoGreenstand:masterfrom
Open
chore: remove redundant Dispatchers.Main from viewModelScope.launch#1255evanofficial wants to merge 1 commit intoGreenstand:masterfrom
evanofficial wants to merge 1 commit intoGreenstand:masterfrom
Conversation
viewModelScope.launch already defaults to Dispatchers.Main, so passing it explicitly is misleading. Removed from TreeCaptureViewModel, SignupViewModel, and TreeImageReviewViewModel (all three init blocks follow the same pattern). Also removed now-unused Dispatchers imports. Closes Greenstand#1232
Contributor
|
Thanks for the PR. Please confirm the app works with an attached video by testing the tree capture flow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
viewModelScope.launchalready defaults toDispatchers.Main, so passing it explicitly is redundant and misleads intent.Fixes the two locations called out in the issue:
TreeCaptureViewModel.ktSignupViewModel.ktAlso included a third matching occurrence in
TreeImageReviewViewModel.kt(init block, same pattern) — I asked in the issue comment whether to roll it in. Happy to drop it from this PR if you'd rather keep scope tight to the two files listed.Removed now-unused
kotlinx.coroutines.Dispatchersimports in each of the three files.Closes #1232