From cbd5ec1f256f7dc0ef149fc3822f06abc6a71f3a Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Tue, 11 Oct 2022 17:38:25 +0200 Subject: [PATCH] use correct default for notification silencing --- 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 f41edd24bb7e..f38d58207dcd 100644 --- a/src/utils/notifications.ts +++ b/src/utils/notifications.ts @@ -25,5 +25,5 @@ export function getLocalNotificationAccountDataEventType(deviceId: string): stri 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 b27a660ebfff..9e8a51ad3bda 100644 --- a/test/utils/notifications-test.ts +++ b/test/utils/notifications-test.ts @@ -47,8 +47,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 });