Prevent crash when logging in
Some checks reported errors
continuous-integration/drone/pr Build was killed
Some checks reported errors
continuous-integration/drone/pr Build was killed
This commit is contained in:
parent
8b0bbe71c9
commit
c25e8889a4
@ -43,12 +43,13 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap
|
|||||||
init {
|
init {
|
||||||
// TODO: Dispatchers.IO not available in KMM, an alternative solution should be found
|
// TODO: Dispatchers.IO not available in KMM, an alternative solution should be found
|
||||||
connectivityStatus.start()
|
connectivityStatus.start()
|
||||||
|
if (appSettingsService.getBaseUrl() != "") {
|
||||||
runBlocking {
|
runBlocking {
|
||||||
updateApiVersion()
|
updateApiVersion()
|
||||||
dateUtils = DateUtils(appSettingsService)
|
|
||||||
reloadBadges()
|
reloadBadges()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun getNewerItems(): ArrayList<SelfossModel.Item> {
|
suspend fun getNewerItems(): ArrayList<SelfossModel.Item> {
|
||||||
// TODO: Use the updatedSince parameter
|
// TODO: Use the updatedSince parameter
|
||||||
@ -408,6 +409,7 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap
|
|||||||
appSettingsService.updateApiVersion(fetchedVersion.data.getApiMajorVersion())
|
appSettingsService.updateApiVersion(fetchedVersion.data.getApiMajorVersion())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dateUtils = DateUtils(appSettingsService)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isNetworkAvailable() = isConnectionAvailable.value && !offlineOverride
|
fun isNetworkAvailable() = isConnectionAvailable.value && !offlineOverride
|
||||||
|
Loading…
Reference in New Issue
Block a user