minor stuff done like BG color of chat window
This commit is contained in:
parent
18956ee953
commit
d9d3ada6a0
4 changed files with 16 additions and 11 deletions
|
|
@ -43,9 +43,13 @@ document.addEventListener("visibilitychange", async () => {
|
|||
if (socketId == undefined) return;
|
||||
if (document.visibilityState === "hidden") {
|
||||
let userName = await updateUser();
|
||||
oldName = userName?.name || "undefined";
|
||||
localStorage.setItem("oldName", oldName);
|
||||
socketId.emit("client_left");
|
||||
oldName = userName?.name || undefined;
|
||||
if (oldName === undefined) return;
|
||||
localStorage.setItem('oldName', oldName);
|
||||
socketId.emit('client_left', {
|
||||
user: userName?.name,
|
||||
why: 'tab window hidden - socket not dead',
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (document.visibilityState === "visible") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue