mirror of https://github.com/vector-im/riot-web
[Backport staging] use correct default for notification silencing (#9389)
Co-authored-by: Kerry <kerrya@element.io>pull/28788/head^2
parent
9dc82fb486
commit
67cae5fe45
|
@ -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<LocalNotificationSettings>()?.is_silenced ?? true;
|
||||
return event?.getContent<LocalNotificationSettings>()?.is_silenced ?? false;
|
||||
}
|
||||
|
|
|
@ -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 });
|
||||
|
|
Loading…
Reference in New Issue