From 9e055ee99ddcc45e8bc710abe391f6d694c842e9 Mon Sep 17 00:00:00 2001 From: Kerry Date: Tue, 11 Oct 2022 18:11:11 +0200 Subject: [PATCH] use correct default for notification silencing (#9388) --- src/utils/notifications.ts | 2 +- test/utils/notifications-test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/notifications.ts b/src/utils/notifications.ts index 7e8aff6d0b..0064eaf2bc 100644 --- a/src/utils/notifications.ts +++ b/src/utils/notifications.ts @@ -51,5 +51,5 @@ export async function createLocalNotificationSettingsIfNeeded(cli: MatrixClient) export function localNotificationsAreSilenced(cli: MatrixClient): boolean { const eventType = getLocalNotificationAccountDataEventType(cli.deviceId); const event = cli.getAccountData(eventType); - return event?.getContent()?.is_silenced ?? true; + return event?.getContent()?.is_silenced ?? false; } diff --git a/test/utils/notifications-test.ts b/test/utils/notifications-test.ts index ba134c1480..c44b496608 100644 --- a/test/utils/notifications-test.ts +++ b/test/utils/notifications-test.ts @@ -81,8 +81,8 @@ describe('notifications', () => { }); describe('localNotificationsAreSilenced', () => { - it('defaults to true when no setting exists', () => { - expect(localNotificationsAreSilenced(mockClient)).toBeTruthy(); + it('defaults to false when no setting exists', () => { + expect(localNotificationsAreSilenced(mockClient)).toBeFalsy(); }); it('checks the persisted value', () => { mockClient.setAccountData(accountDataEventKey, { is_silenced: true });