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

Commit fe5d0da

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

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
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: 4 additions & 4 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
}
@@ -90,6 +90,6 @@ export function toNotificationSettings(
9090
]),
9191
keywords: shouldNotify(contentRules),
9292
},
93-
keywords: contentRules.map((it) => it.pattern),
93+
keywords: contentRules.map((it) => it.pattern!),
9494
};
9595
}

0 commit comments

Comments
 (0)