fix(ui/setup): thread exception

Method setCurrentState must be called on the main thread
This commit is contained in:
rhunk
2024-10-07 18:11:41 +02:00
parent 983e5932c7
commit 7458d57c27

View File

@@ -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
@@ -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