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
1 changed files with 5 additions and 1 deletions
|
@ -1843,7 +1843,11 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
} else {
|
} else {
|
||||||
subtitle = `${this.subTitleStatus} ${subtitle}`;
|
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) {
|
updateStatusIndicator(state: string, prevState: string) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue