Complete the disconnection before redirecting to the login screen #129

Merged
AmineB merged 1 commits from davidoskky/ReaderForSelfoss-multiplatform:disconnect into master 2023-01-28 10:19:45 +00:00

View File

@ -36,6 +36,7 @@ import com.ashokvarma.bottomnavigation.TextBadgeItem
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import org.kodein.di.DIAware
import org.kodein.di.android.closestDI
import org.kodein.di.instance
@ -588,12 +589,12 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
return true
}
R.id.action_disconnect -> {
CoroutineScope(Dispatchers.Main).launch {
runBlocking {
repository.logout()
}
this@HomeActivity.finish()
val intent = Intent(this, LoginActivity::class.java)
this.startActivity(intent)
finish()
return true
}
R.id.action_settings -> {