Skip to content

Commit

Permalink
fix(ui/setup): thread exception
Browse files Browse the repository at this point in the history
Method setCurrentState must be called on the main thread
  • Loading branch information
rhunk committed Oct 7, 2024
1 parent 983e593 commit 7458d57
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import me.rhunk.snapenhance.ui.setup.screens.SetupScreen
import me.rhunk.snapenhance.ui.util.AlertDialogs

Expand Down Expand Up @@ -51,7 +52,9 @@ class MappingsScreen : SetupScreen() {
return@launch
}

goNext()
withContext(Dispatchers.Main) {
goNext()
}
}.onFailure {
isGenerating = false
infoText = context.translation["setup.mappings.generate_failure"] + "\n\n" + it.message
Expand Down

0 comments on commit 7458d57

Please sign in to comment.