diff --git a/src/client/chat.jsx b/src/client/chat.jsx index e32f92e..73b7ee6 100644 --- a/src/client/chat.jsx +++ b/src/client/chat.jsx @@ -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; diff --git a/src/client/home.jsx b/src/client/home.jsx index 62b6231..bd03a85 100644 --- a/src/client/home.jsx +++ b/src/client/home.jsx @@ -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 (