Apply unread count setting upon change

Change-Id: Idf3d32045bdfca462a281ccf13d5c758fed2e2c5
This commit is contained in:
SpiritCroc 2021-09-22 17:50:30 +02:00
parent cc13146f81
commit d1273985b8

View File

@ -32,6 +32,7 @@ import com.google.android.material.badge.BadgeDrawable
import im.vector.app.R
import im.vector.app.RoomGroupingMethod
import im.vector.app.core.extensions.commitTransaction
import im.vector.app.core.extensions.restart
import im.vector.app.core.extensions.toMvRxBundle
import im.vector.app.core.platform.ToolbarConfigurable
import im.vector.app.core.platform.VectorBaseActivity
@ -83,6 +84,9 @@ class HomeDetailFragment @Inject constructor(
private lateinit var sharedActionViewModel: HomeSharedActionViewModel
private lateinit var sharedCallActionViewModel: SharedKnownCallsViewModel
// When this changes, restart the activity for changes to apply
private val shouldShowUnimportantCounterBadge = vectorPreferences.shouldShowUnimportantCounterBadge()
private var hasUnreadRooms = false
set(value) {
if (value != field) {
@ -201,6 +205,12 @@ class HomeDetailFragment @Inject constructor(
override fun onResume() {
super.onResume()
if (vectorPreferences.shouldShowUnimportantCounterBadge() != shouldShowUnimportantCounterBadge) {
activity?.restart()
return
}
// update notification tab if needed
//updateTabVisibilitySafely(R.id.bottom_action_notification, vectorPreferences.labAddNotificationTab())