We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3971f76 commit 3fc6ea2Copy full SHA for 3fc6ea2
client/src/components/Navbar.tsx
@@ -23,14 +23,16 @@ export const Navbar = ({ options }: NavbarProps) => {
23
const location = useLocation();
24
const pollId = cookies.get(pollIdCookie);
25
const [totalVotes, setTotalVotes] = useState(0);
26
- document.title = mcsPollVoting;
+
27
+ if (location.pathname === voteControlsPath) {
28
+ document.title = `Votes: ${totalVotes}`;
29
+ } else {
30
+ document.title = mcsPollVoting;
31
+ }
32
33
const resultHandler = (res: any) => {
34
const currentVotes = res.totalVotes;
35
setTotalVotes(currentVotes);
- if (location.pathname === voteControlsPath) {
- document.title = `Votes: ${currentVotes}`;
- }
36
};
37
38
socket.on("result", resultHandler);
0 commit comments