mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Only set title when it changes
I've seen Chromium constantly refresh the title in the developer tools. To be honest, I'm not sure if this means Chromium wastes CPU time changing a title, but this may introduce better performance. Signed-off-by: Resynth <resynth1943@tutanota.com>
This commit is contained in:
parent
8ec7e7c714
commit
747f9fba38
@ -1843,7 +1843,11 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
} else {
|
||||
subtitle = `${this.subTitleStatus} ${subtitle}`;
|
||||
}
|
||||
document.title = `${SdkConfig.get().brand} ${subtitle}`;
|
||||
const title = `${SdkConfig.get().brand} ${subtitle}`;
|
||||
|
||||
if (document.title !== title) {
|
||||
document.title = title;
|
||||
}
|
||||
}
|
||||
|
||||
updateStatusIndicator(state: string, prevState: string) {
|
||||
|
Loading…
Reference in New Issue
Block a user