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

Commit 9e055ee

Browse files
author
Kerry
authored
use correct default for notification silencing (#9388)
1 parent 7c1c495 commit 9e055ee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/utils/notifications.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ export async function createLocalNotificationSettingsIfNeeded(cli: MatrixClient)
5151
export function localNotificationsAreSilenced(cli: MatrixClient): boolean {
5252
const eventType = getLocalNotificationAccountDataEventType(cli.deviceId);
5353
const event = cli.getAccountData(eventType);
54-
return event?.getContent<LocalNotificationSettings>()?.is_silenced ?? true;
54+
return event?.getContent<LocalNotificationSettings>()?.is_silenced ?? false;
5555
}

test/utils/notifications-test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ describe('notifications', () => {
8181
});
8282

8383
describe('localNotificationsAreSilenced', () => {
84-
it('defaults to true when no setting exists', () => {
85-
expect(localNotificationsAreSilenced(mockClient)).toBeTruthy();
84+
it('defaults to false when no setting exists', () => {
85+
expect(localNotificationsAreSilenced(mockClient)).toBeFalsy();
8686
});
8787
it('checks the persisted value', () => {
8888
mockClient.setAccountData(accountDataEventKey, { is_silenced: true });

0 commit comments

Comments
 (0)