Improve document.title handling

This commit is contained in:
Ken-Håvard Lieng 2018-11-22 10:09:13 +01:00
parent 09a1933131
commit bd0541120f
2 changed files with 52 additions and 48 deletions

File diff suppressed because one or more lines are too long

View File

@ -8,16 +8,20 @@ export default function documentTitle({ store }) {
let title;
if (router.route === 'chat') {
const { name } = router.params;
const { server, name } = router.params;
if (name) {
title = `${name} @ ${serverName}`;
title = `${name} @ ${serverName || server}`;
} else {
title = serverName;
title = serverName || server;
}
} else {
title = capitalize(router.route);
}
document.title = `${title} | Dispatch`;
if (title) {
document.title = `${title} | Dispatch`;
} else {
document.title = 'Dispatch';
}
});
}