Complete the disconnection before redirecting to the login screen
This commit is contained in:
parent
40e1d1478b
commit
389a04d250
@ -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 -> {
|
||||
|
Loading…
Reference in New Issue
Block a user