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