feat: page title

This commit is contained in:
cha0s 2020-07-25 09:59:32 -05:00
parent 1dcbe1f0ca
commit 1ef834db51
2 changed files with 7 additions and 1 deletions

View File

@ -37,6 +37,9 @@ export default function Chat() {
if (!hasChannel && validateChannel(channel)) {
dispatch(submitJoin({channel: channel.toLowerCase(), id: user.id}));
}
if (hasChannel) {
window.document.title = `${channel} | reddichat`;
}
});
if (!allowedUser || !hasChannel) {
return null;

View File

@ -19,7 +19,10 @@ export default function Home() {
else if (user.id) {
path = '/chat';
}
dispatch(replace(path));
if (path) {
dispatch(replace(path));
}
window.document.title = 'reddichat';
});
return (
<div className="home">