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 {
|
private suspend fun canReachRevolt(): Boolean {
|
||||||
val res = RevoltHttp.get("/".api())
|
try {
|
||||||
return res.status.value == 200
|
val res = RevoltHttp.get("/".api())
|
||||||
|
return res.status.value == 200
|
||||||
|
} catch (e: Exception) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun startWithDestination(destination: String) {
|
private suspend fun startWithDestination(destination: String) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue