fix(setup/ui): mappings screen crash
This commit is contained in:
@@ -220,9 +220,9 @@ class RemoteSideContext(
|
||||
requirements = requirements or Requirements.MAPPINGS
|
||||
}
|
||||
|
||||
/*if (sharedPreferences.getString("sif", null) == null) {
|
||||
if (sharedPreferences.getString("sif", null) == null) {
|
||||
requirements = requirements or Requirements.SIF
|
||||
}*/
|
||||
}
|
||||
|
||||
if (requirements == 0) return false
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class SetupActivity : ComponentActivity() {
|
||||
if (isFirstRun || hasRequirement(Requirements.MAPPINGS)) {
|
||||
add(MappingsScreen().apply { route = "mappings" })
|
||||
}
|
||||
if (hasRequirement(Requirements.SIF)) {
|
||||
if (isFirstRun || hasRequirement(Requirements.SIF)) {
|
||||
add(SecurityScreen().apply { route = "security" })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -40,7 +41,9 @@ class MappingsScreen : SetupScreen() {
|
||||
throw Exception(context.translation["setup.mappings.generate_failure_no_snapchat"])
|
||||
}
|
||||
context.mappings.refresh()
|
||||
goNext()
|
||||
withContext(Dispatchers.Main) {
|
||||
goNext()
|
||||
}
|
||||
}.onFailure {
|
||||
isGenerating = false
|
||||
infoText = context.translation["setup.mappings.generate_failure"] + "\n\n" + it.message
|
||||
|
||||
Reference in New Issue
Block a user