fix crash when instance info fails to load (#4335)
Steps to reproduce: Cold start the app while being logged in and offline.
This commit is contained in:
parent
00d7cc72b1
commit
c7a1ddd589
1 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@ import at.connyduck.calladapter.networkresult.getOrElse
|
|||
import at.connyduck.calladapter.networkresult.getOrThrow
|
||||
import at.connyduck.calladapter.networkresult.map
|
||||
import at.connyduck.calladapter.networkresult.onSuccess
|
||||
import at.connyduck.calladapter.networkresult.recover
|
||||
import at.connyduck.calladapter.networkresult.recoverCatching
|
||||
import com.keylesspalace.tusky.db.AccountManager
|
||||
import com.keylesspalace.tusky.db.AppDatabase
|
||||
import com.keylesspalace.tusky.db.EmojisEntity
|
||||
|
@ -117,7 +117,7 @@ class InstanceInfoRepository @Inject constructor(
|
|||
val instance = this.instanceName
|
||||
return api.getInstance()
|
||||
.map { it.toEntity() }
|
||||
.recover { t ->
|
||||
.recoverCatching { t ->
|
||||
if (t.isHttpNotFound()) {
|
||||
api.getInstanceV1().map { it.toEntity(instance) }.getOrThrow()
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue