diff --git a/frontend/src/chat/chat.css b/frontend/src/chat/chat.css index 9b4b0f1..7d2e20c 100644 --- a/frontend/src/chat/chat.css +++ b/frontend/src/chat/chat.css @@ -263,7 +263,6 @@ div-private { @apply bg-white rounded-xl - shadow-xl w-200 h-33 p-6 diff --git a/frontend/src/chat/chat.html b/frontend/src/chat/chat.html index e4601d3..a6301a8 100644 --- a/frontend/src/chat/chat.html +++ b/frontend/src/chat/chat.html @@ -35,11 +35,11 @@ diff --git a/frontend/src/chat/chat.ts b/frontend/src/chat/chat.ts index 2e0746d..22d931c 100644 --- a/frontend/src/chat/chat.ts +++ b/frontend/src/chat/chat.ts @@ -422,17 +422,19 @@ sendtextbox.addEventListener("keydown", (event) => { } }); -chatButton!.addEventListener("click", async () => { +chatButton!.addEventListener("click",() => { if (chatBox.classList.contains("hidden")) { chatBox.classList.toggle("hidden"); overlay.classList.add("opacity-60"); - await windowStateVisable(); - + windowStateVisable(); + let socket = window.__state.chatSock; + if (!socket) return; + connected(socket); } else { chatBox.classList.toggle("hidden"); overlay.classList.remove("opacity-60"); - await windowStateHidden(); + windowStateHidden(); } }); diff --git a/frontend/src/chat/chatHelperFunctions/openMessagePopup.ts b/frontend/src/chat/chatHelperFunctions/openMessagePopup.ts index 2302468..f37c547 100644 --- a/frontend/src/chat/chatHelperFunctions/openMessagePopup.ts +++ b/frontend/src/chat/chatHelperFunctions/openMessagePopup.ts @@ -13,7 +13,7 @@ export async function openMessagePopup(message: any) { if (modalmessage) { const messageElement = document.createElement("div"); messageElement.innerHTML = ` -
Next Game Message ${incrementCounter()}: ${obj.nextGame}
+
Game-Info: ${incrementCounter()}: ${obj.nextGame}
`; modalmessage.appendChild(messageElement); modalmessage.scrollTop = modalmessage.scrollHeight; diff --git a/frontend/src/pages/pong/pong.ts b/frontend/src/pages/pong/pong.ts index 4ce307a..2262608 100644 --- a/frontend/src/pages/pong/pong.ts +++ b/frontend/src/pages/pong/pong.ts @@ -14,6 +14,7 @@ import { getUser as getSelfUser, type User } from "@app/auth"; import { isNullish } from "@app/utils"; import client from "@app/api"; import "./pong.css"; +import { quitChat } from "@app/chat/chatHelperFunctions/quitChat"; declare module "ft_state" { interface State { @@ -249,6 +250,7 @@ function pongClient( switch (res) { case JoinRes.yes : showInfo('JoinRes = yes'); + quitChat(); break; case JoinRes.no : showInfo('JoinRes = no');