Add device notifications enabled switch (#9324)

This commit is contained in:
Germain 2022-09-28 18:13:09 +01:00 committed by GitHub
parent 1a0dbbf192
commit e15ef9f3de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 251 additions and 31 deletions

View file

@ -1,5 +1,5 @@
/*
Copyright 2015-2021 The Matrix.org Foundation C.I.C.
Copyright 2015-2022 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -137,6 +137,7 @@ import { TimelineRenderingType } from "../../contexts/RoomContext";
import { UseCaseSelection } from '../views/elements/UseCaseSelection';
import { ValidatedServerConfig } from '../../utils/ValidatedServerConfig';
import { isLocalRoom } from '../../utils/localRoom/isLocalRoom';
import { createLocalNotificationSettingsIfNeeded } from '../../utils/notifications';
// legacy export
export { default as Views } from "../../Views";
@ -1257,6 +1258,9 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
this.themeWatcher.recheck();
StorageManager.tryPersistStorage();
const cli = MatrixClientPeg.get();
createLocalNotificationSettingsIfNeeded(cli);
if (
MatrixClientPeg.currentUserIsJustRegistered() &&
SettingsStore.getValue("FTUE.useCaseSelection") === null