修复无网崩溃
This commit is contained in:
@@ -84,21 +84,25 @@ fun LoginPage() {
|
|||||||
mutableStateOf(false)
|
mutableStateOf(false)
|
||||||
}
|
}
|
||||||
suspend fun checkGoogleLoginEnable() {
|
suspend fun checkGoogleLoginEnable() {
|
||||||
val result = dictService.getDistList(
|
try {
|
||||||
listOf(
|
val result = dictService.getDistList(
|
||||||
ConstVars.DICT_KEY_ENABLE_GOOGLE_LOGIN,
|
listOf(
|
||||||
ConstVars.DICT_KEY_GOOGLE_LOGIN_CLIENT_ID
|
ConstVars.DICT_KEY_ENABLE_GOOGLE_LOGIN,
|
||||||
|
ConstVars.DICT_KEY_GOOGLE_LOGIN_CLIENT_ID
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
val enableDictItem = result.find { it.key == ConstVars.DICT_KEY_ENABLE_GOOGLE_LOGIN }
|
||||||
val enableDictItem = result.find { it.key == ConstVars.DICT_KEY_ENABLE_GOOGLE_LOGIN }
|
val clientIdDictItem = result.find { it.key == ConstVars.DICT_KEY_GOOGLE_LOGIN_CLIENT_ID }
|
||||||
val clientIdDictItem = result.find { it.key == ConstVars.DICT_KEY_GOOGLE_LOGIN_CLIENT_ID }
|
if (enableDictItem != null && clientIdDictItem != null) {
|
||||||
if (enableDictItem != null && clientIdDictItem != null) {
|
AppState.googleClientId = clientIdDictItem.value as? String
|
||||||
AppState.googleClientId = clientIdDictItem.value as? String
|
showGoogleLogin = enableDictItem.value == true
|
||||||
showGoogleLogin = enableDictItem.value == true
|
} else {
|
||||||
} else {
|
showGoogleLogin = false
|
||||||
showGoogleLogin = false
|
}
|
||||||
|
AppState.enableGoogleLogin = showGoogleLogin
|
||||||
|
} catch (_: Exception) {
|
||||||
|
|
||||||
}
|
}
|
||||||
AppState.enableGoogleLogin = showGoogleLogin
|
|
||||||
}
|
}
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
statusBarController.setStatusBarColor(Color.Transparent, darkIcons = !AppState.darkMode)
|
statusBarController.setStatusBarColor(Color.Transparent, darkIcons = !AppState.darkMode)
|
||||||
|
|||||||
Reference in New Issue
Block a user