mirror of
https://github.com/vector-im/element-web.git
synced 2025-12-25 19:21:18 +01:00
Fix so that we still use notificationsMuted / unread even if a room isn't in view.
This commit is contained in:
parent
b589757c34
commit
bcf9854a4c
@ -1944,20 +1944,18 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
let context: AppTitleContext = {
|
||||
brand: SdkConfig.get().brand,
|
||||
syncError: extraContext?.syncState === SyncState.Error,
|
||||
notificationsMuted: extraContext && extraContext.userNotificationLevel < NotificationLevel.Activity,
|
||||
unreadNotificationCount: extraContext?.unreadNotificationCount,
|
||||
};
|
||||
|
||||
if (extraContext) {
|
||||
if (this.state.currentRoomId) {
|
||||
const client = MatrixClientPeg.get();
|
||||
const room = client?.getRoom(this.state.currentRoomId);
|
||||
context = {
|
||||
...context,
|
||||
roomId: this.state.currentRoomId,
|
||||
roomName: room?.name,
|
||||
notificationsMuted: extraContext.userNotificationLevel < NotificationLevel.Activity,
|
||||
unreadNotificationCount: extraContext.unreadNotificationCount,
|
||||
};
|
||||
}
|
||||
if (this.state.currentRoomId) {
|
||||
const client = MatrixClientPeg.get();
|
||||
const room = client?.getRoom(this.state.currentRoomId);
|
||||
context = {
|
||||
...context,
|
||||
roomId: this.state.currentRoomId,
|
||||
roomName: room?.name,
|
||||
};
|
||||
}
|
||||
|
||||
const moduleTitle = ModuleRunner.instance.extensions.branding?.getAppTitle(context);
|
||||
@ -1968,13 +1966,15 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
return;
|
||||
}
|
||||
|
||||
// Use application default.
|
||||
|
||||
let subtitle = "";
|
||||
if (context?.syncError) {
|
||||
subtitle += `[${_t("common|offline")}] `;
|
||||
}
|
||||
if ('unreadNotificationCount' in context && context.unreadNotificationCount > 0) {
|
||||
if (context.unreadNotificationCount !== undefined && context.unreadNotificationCount > 0) {
|
||||
subtitle += `[${context.unreadNotificationCount}]`;
|
||||
} else if ('notificationsMuted' in context && !context.notificationsMuted) {
|
||||
} else if (context.notificationsMuted !== undefined && !context.notificationsMuted) {
|
||||
subtitle += `*`;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user