From 1ef834db5131f3c15d4d2acf12d3881f85aac899 Mon Sep 17 00:00:00 2001 From: cha0s Date: Sat, 25 Jul 2020 09:59:32 -0500 Subject: [PATCH] feat: page title --- src/client/chat.jsx | 3 +++ src/client/home.jsx | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 (