fix: startup crash in some network environments

Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
Infi 2024-11-23 13:55:09 +01:00
parent 3b17dc7bba
commit 20a066dabb
1 changed files with 6 additions and 2 deletions

View File

@ -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) {