Do not change the network override from within the repository
This commit is contained in:
parent
d1481a1db6
commit
3c5b606a02
@ -1024,6 +1024,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
|
|||||||
Toast.makeText(this, R.string.refresh_in_progress, Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, R.string.refresh_in_progress, Toast.LENGTH_SHORT).show()
|
||||||
// TODO: Use Dispatchers.IO
|
// TODO: Use Dispatchers.IO
|
||||||
CoroutineScope(Dispatchers.Main).launch {
|
CoroutineScope(Dispatchers.Main).launch {
|
||||||
|
repository.offlineOverride = false
|
||||||
val updatedRemote = repository.updateRemote()
|
val updatedRemote = repository.updateRemote()
|
||||||
if (updatedRemote) {
|
if (updatedRemote) {
|
||||||
// TODO: Send toast messages from the repository
|
// TODO: Send toast messages from the repository
|
||||||
|
@ -333,7 +333,6 @@ class Repository(private val api: SelfossApi, private val apiDetails: ApiDetails
|
|||||||
|
|
||||||
suspend fun updateRemote(): Boolean {
|
suspend fun updateRemote(): Boolean {
|
||||||
var response = false
|
var response = false
|
||||||
offlineOverride = false
|
|
||||||
if (isConnectionAvailable.value) {
|
if (isConnectionAvailable.value) {
|
||||||
response = api.update()?.isSuccess == true
|
response = api.update()?.isSuccess == true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user