network #28

Merged
AmineB merged 28 commits from davidoskky/ReaderForSelfoss-multiplatform:network into master 2022-08-22 19:01:16 +00:00
Showing only changes of commit 13ea7a693b - Show all commits

View File

@ -322,7 +322,8 @@ class Repository(private val api: SelfossApi, private val apiDetails: ApiDetails
suspend fun updateRemote(): Boolean {
var response = false
AmineB marked this conversation as resolved Outdated

This should use the same isNetworkAvailable() function as the others.

This should use the same `isNetworkAvailable()` function as the others.

And it can be refactored as the ones before.

And it can be refactored as the ones before.
if (isConnectionAvailable.value && !offlineOverride) {
offlineOverride = false
AmineB marked this conversation as resolved Outdated

It's weird to have this here. offlineOverride shouldn't be overridden from inside the repository.

If offlineOverride is true then return false.

There is no need for an exception for this method.

It's weird to have this here. `offlineOverride` shouldn't be overridden from inside the repository. If `offlineOverride` is `true` then return `false`. There is no need for an exception for this method.
if (isConnectionAvailable.value) {
response = api.update()?.isSuccess == true
}
return response