fix: startup crash in some network environments
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
3b17dc7bba
commit
20a066dabb
|
|
@ -118,8 +118,12 @@ class MainActivityViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
private suspend fun canReachRevolt(): Boolean {
|
||||
val res = RevoltHttp.get("/".api())
|
||||
return res.status.value == 200
|
||||
try {
|
||||
val res = RevoltHttp.get("/".api())
|
||||
return res.status.value == 200
|
||||
} catch (e: Exception) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun startWithDestination(destination: String) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue