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

Commit 67cae5f

Browse files
RiotRobotKerry
and
Kerry
authored
[Backport staging] use correct default for notification silencing (#9389)
Co-authored-by: Kerry <[email protected]>
1 parent 9dc82fb commit 67cae5f

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
@@ -25,5 +25,5 @@ export function getLocalNotificationAccountDataEventType(deviceId: string): stri
2525
export function localNotificationsAreSilenced(cli: MatrixClient): boolean {
2626
const eventType = getLocalNotificationAccountDataEventType(cli.deviceId);
2727
const event = cli.getAccountData(eventType);
28-
return event?.getContent<LocalNotificationSettings>()?.is_silenced ?? true;
28+
return event?.getContent<LocalNotificationSettings>()?.is_silenced ?? false;
2929
}

test/utils/notifications-test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ describe('notifications', () => {
4747
});
4848

4949
describe('localNotificationsAreSilenced', () => {
50-
it('defaults to true when no setting exists', () => {
51-
expect(localNotificationsAreSilenced(mockClient)).toBeTruthy();
50+
it('defaults to false when no setting exists', () => {
51+
expect(localNotificationsAreSilenced(mockClient)).toBeFalsy();
5252
});
5353
it('checks the persisted value', () => {
5454
mockClient.setAccountData(accountDataEventKey, { is_silenced: true });

0 commit comments

Comments
 (0)