mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Notification: dismiss all on sign out
This commit is contained in:
parent
785f33177d
commit
f6c500d120
@ -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 New Issue
Block a user