Fix title being empty
This commit is contained in:
parent
e7fd95e2cd
commit
3690de9fe0
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Vite + React + TS</title>
|
<title>FF Jitsi Rooms</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
|
@ -11,10 +11,13 @@ function useRoomName() {
|
||||||
[setRoomName]
|
[setRoomName]
|
||||||
);
|
);
|
||||||
|
|
||||||
const submitRoomName = useCallback(() => {
|
const submitRoomName = useCallback(
|
||||||
setRoomNameInUrl(roomName);
|
() => {
|
||||||
setRoomNameInTitle(roomName);
|
setRoomNameInUrl(roomName);
|
||||||
}, [roomName]);
|
setRoomNameInTitle(roomName);
|
||||||
|
},
|
||||||
|
[roomName]
|
||||||
|
);
|
||||||
|
|
||||||
return { roomName, updateRoomName, submitRoomName };
|
return { roomName, updateRoomName, submitRoomName };
|
||||||
}
|
}
|
||||||
|
@ -34,7 +37,9 @@ function setRoomNameInUrl(roomName: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setRoomNameInTitle(roomName: string) {
|
function setRoomNameInTitle(roomName: string) {
|
||||||
document.title = roomName;
|
if (!!roomName) {
|
||||||
|
document.title = roomName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { useRoomName };
|
export { useRoomName };
|
||||||
|
|
Loading…
Reference in New Issue