mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-27 03:49:04 +03:00
Notification: dismiss all on sign out
This commit is contained in:
parent
785f33177d
commit
f6c500d120
2 changed files with 8 additions and 2 deletions
|
@ -166,7 +166,8 @@ class HomeActivity : VectorBaseActivity(), ToolbarConfigurable {
|
|||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.sliding_menu_sign_out -> {
|
||||
SignOutUiWorker(this).perform(Matrix.getInstance().currentSession!!)
|
||||
SignOutUiWorker(this, notificationDrawerManager)
|
||||
.perform(Matrix.getInstance().currentSession!!)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,8 +21,10 @@ import im.vector.matrix.android.api.session.Session
|
|||
import im.vector.riotredesign.R
|
||||
import im.vector.riotredesign.core.platform.VectorBaseActivity
|
||||
import im.vector.riotredesign.features.MainActivity
|
||||
import im.vector.riotredesign.features.notifications.NotificationDrawerManager
|
||||
|
||||
class SignOutUiWorker(val activity: VectorBaseActivity) {
|
||||
class SignOutUiWorker(private val activity: VectorBaseActivity,
|
||||
private val notificationDrawerManager: NotificationDrawerManager) {
|
||||
|
||||
fun perform(session: Session) {
|
||||
if (SignOutViewModel.doYouNeedToBeDisplayed(session)) {
|
||||
|
@ -45,6 +47,9 @@ class SignOutUiWorker(val activity: VectorBaseActivity) {
|
|||
}
|
||||
|
||||
private fun doSignOut() {
|
||||
// Dismiss all notifications
|
||||
notificationDrawerManager.clearAllEvents()
|
||||
|
||||
MainActivity.restartApp(activity, clearCache = true, clearCredentials = true)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue