From 389a04d250a54488f2531db9a15fe35d33266393 Mon Sep 17 00:00:00 2001 From: davidoskky Date: Fri, 27 Jan 2023 14:21:33 +0100 Subject: [PATCH] Complete the disconnection before redirecting to the login screen --- .../amine/apps/readerforselfossv2/android/HomeActivity.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/HomeActivity.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/HomeActivity.kt index 64f9428..6f4537b 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/HomeActivity.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/HomeActivity.kt @@ -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 -> { -- 2.34.1