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

Commit

Permalink
make ts-strict happier
Browse files Browse the repository at this point in the history
  • Loading branch information
justjanne committed Jun 14, 2023
1 parent 66fc8df commit 91a980c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export function reconcileNotificationSettings(
enabled: model.mentions.keywords,
});
}
newKeywords.delete(rule.pattern);
newKeywords.delete(rule.pattern!);
}
for (const keyword of newKeywords) {
changes.added.push({
Expand Down
6 changes: 3 additions & 3 deletions src/models/notificationsettings/toNotificationSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ function shouldNotify(rules: (IPushRule | null | undefined | false)[]): boolean
continue;
}
const actions = NotificationUtils.decodeActions(rule.actions);
if (actions.notify) {
if (actions !== null && actions.notify) {
return true;
}
}
return false;
}

function determineSound(rules: (IPushRule | null | undefined | false)[]): string | null {
function determineSound(rules: (IPushRule | null | undefined | false)[]): string | undefined {
for (const rule of rules) {
if (rule === null || rule === undefined || rule === false || !rule.enabled) {
continue;
}
const actions = NotificationUtils.decodeActions(rule.actions);
if (actions.notify && actions.sound !== undefined) {
if (actions !== null && actions.notify && actions.sound !== undefined) {
return actions.sound;
}
}
Expand Down

0 comments on commit 91a980c

Please sign in to comment.