Skip to content

chore: remove redundant Dispatchers.Main from viewModelScope.launch#1255

Open
evanofficial wants to merge 1 commit intoGreenstand:masterfrom
evanofficial:remove-redundant-dispatchers-main
Open

chore: remove redundant Dispatchers.Main from viewModelScope.launch#1255
evanofficial wants to merge 1 commit intoGreenstand:masterfrom
evanofficial:remove-redundant-dispatchers-main

Conversation

@evanofficial
Copy link
Copy Markdown
Contributor

viewModelScope.launch already defaults to Dispatchers.Main, so passing it explicitly is redundant and misleads intent.

Fixes the two locations called out in the issue:

  • TreeCaptureViewModel.kt
  • SignupViewModel.kt

Also 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.Dispatchers imports in each of the three files.

Closes #1232

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
@Elforama
Copy link
Copy Markdown
Contributor

Elforama commented Apr 5, 2026

Thanks for the PR. Please confirm the app works with an attached video by testing the tree capture flow.

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.

Remove unnecessary Dispatchers.Main on viewModelScope.launch

2 participants