Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 91a980c

Browse files
committed
make ts-strict happier
1 parent 66fc8df commit 91a980c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/models/notificationsettings/reconcileNotificationSettings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export function reconcileNotificationSettings(
211211
enabled: model.mentions.keywords,
212212
});
213213
}
214-
newKeywords.delete(rule.pattern);
214+
newKeywords.delete(rule.pattern!);
215215
}
216216
for (const keyword of newKeywords) {
217217
changes.added.push({

src/models/notificationsettings/toNotificationSettings.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ function shouldNotify(rules: (IPushRule | null | undefined | false)[]): boolean
3030
continue;
3131
}
3232
const actions = NotificationUtils.decodeActions(rule.actions);
33-
if (actions.notify) {
33+
if (actions !== null && actions.notify) {
3434
return true;
3535
}
3636
}
3737
return false;
3838
}
3939

40-
function determineSound(rules: (IPushRule | null | undefined | false)[]): string | null {
40+
function determineSound(rules: (IPushRule | null | undefined | false)[]): string | undefined {
4141
for (const rule of rules) {
4242
if (rule === null || rule === undefined || rule === false || !rule.enabled) {
4343
continue;
4444
}
4545
const actions = NotificationUtils.decodeActions(rule.actions);
46-
if (actions.notify && actions.sound !== undefined) {
46+
if (actions !== null && actions.notify && actions.sound !== undefined) {
4747
return actions.sound;
4848
}
4949
}

0 commit comments

Comments
 (0)