This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
src/models/notificationsettings Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ export function reconcileNotificationSettings(
211
211
enabled : model . mentions . keywords ,
212
212
} ) ;
213
213
}
214
- newKeywords . delete ( rule . pattern ) ;
214
+ newKeywords . delete ( rule . pattern ! ) ;
215
215
}
216
216
for ( const keyword of newKeywords ) {
217
217
changes . added . push ( {
Original file line number Diff line number Diff line change @@ -30,20 +30,20 @@ function shouldNotify(rules: (IPushRule | null | undefined | false)[]): boolean
30
30
continue ;
31
31
}
32
32
const actions = NotificationUtils . decodeActions ( rule . actions ) ;
33
- if ( actions . notify ) {
33
+ if ( actions !== null && actions . notify ) {
34
34
return true ;
35
35
}
36
36
}
37
37
return false ;
38
38
}
39
39
40
- function determineSound ( rules : ( IPushRule | null | undefined | false ) [ ] ) : string | null {
40
+ function determineSound ( rules : ( IPushRule | null | undefined | false ) [ ] ) : string | undefined {
41
41
for ( const rule of rules ) {
42
42
if ( rule === null || rule === undefined || rule === false || ! rule . enabled ) {
43
43
continue ;
44
44
}
45
45
const actions = NotificationUtils . decodeActions ( rule . actions ) ;
46
- if ( actions . notify && actions . sound !== undefined ) {
46
+ if ( actions !== null && actions . notify && actions . sound !== undefined ) {
47
47
return actions . sound ;
48
48
}
49
49
}
@@ -90,6 +90,6 @@ export function toNotificationSettings(
90
90
] ) ,
91
91
keywords : shouldNotify ( contentRules ) ,
92
92
} ,
93
- keywords : contentRules . map ( ( it ) => it . pattern ) ,
93
+ keywords : contentRules . map ( ( it ) => it . pattern ! ) ,
94
94
} ;
95
95
}
You can’t perform that action at this time.
0 commit comments