@@ -57,6 +57,7 @@ import {
57
57
import { Caption } from "../typography/Caption" ;
58
58
import { SettingsSubsectionHeading } from "./shared/SettingsSubsectionHeading" ;
59
59
import SettingsSubsection from "./shared/SettingsSubsection" ;
60
+ import { doesRoomHaveUnreadMessages } from "../../../Unread" ;
60
61
61
62
// TODO: this "view" component still has far too much application logic in it,
62
63
// which should be factored out to other files.
@@ -132,6 +133,7 @@ interface IState {
132
133
desktopNotifications : boolean ;
133
134
desktopShowBody : boolean ;
134
135
audioNotifications : boolean ;
136
+ msc3946ProcessDynamicPredecessor : boolean ;
135
137
136
138
clearingNotifications : boolean ;
137
139
@@ -211,6 +213,7 @@ export default class Notifications extends React.PureComponent<IProps, IState> {
211
213
desktopNotifications : SettingsStore . getValue ( "notificationsEnabled" ) ,
212
214
desktopShowBody : SettingsStore . getValue ( "notificationBodyEnabled" ) ,
213
215
audioNotifications : SettingsStore . getValue ( "audioNotificationsEnabled" ) ,
216
+ msc3946ProcessDynamicPredecessor : SettingsStore . getValue ( "feature_dynamic_room_predecessors" ) ,
214
217
clearingNotifications : false ,
215
218
ruleIdsWithError : { } ,
216
219
} ;
@@ -228,6 +231,9 @@ export default class Notifications extends React.PureComponent<IProps, IState> {
228
231
SettingsStore . watchSetting ( "audioNotificationsEnabled" , null , ( ...[ , , , , value ] ) =>
229
232
this . setState ( { audioNotifications : value as boolean } ) ,
230
233
) ,
234
+ SettingsStore . watchSetting ( "feature_dynamic_room_predecessors" , null , ( ...[ , , , , value ] ) =>
235
+ this . setState ( { msc3946ProcessDynamicPredecessor : value as boolean } ) ,
236
+ ) ,
231
237
] ;
232
238
}
233
239
@@ -739,7 +745,7 @@ export default class Notifications extends React.PureComponent<IProps, IState> {
739
745
category === RuleClass . VectorOther &&
740
746
MatrixClientPeg . safeGet ( )
741
747
. getRooms ( )
742
- . some ( ( r ) => r . getUnreadNotificationCount ( ) > 0 )
748
+ . some ( ( r ) => ! r . isSpaceRoom ( ) && doesRoomHaveUnreadMessages ( r , true ) )
743
749
) {
744
750
clearNotifsButton = (
745
751
< AccessibleButton
0 commit comments