Modification win.loc to navigateTO()
This commit is contained in:
parent
b49641d71c
commit
ca1865b850
3 changed files with 13 additions and 6 deletions
|
|
@ -9,6 +9,7 @@ import type {
|
|||
import type { User } from "@app/auth";
|
||||
import {
|
||||
addRoute,
|
||||
navigateTo,
|
||||
setTitle,
|
||||
type RouteHandlerParams,
|
||||
type RouteHandlerReturn,
|
||||
|
|
@ -312,14 +313,14 @@ sendButton?.addEventListener("click", () => {
|
|||
|
||||
case "@pong":
|
||||
if (msgCommand[1] === "") {
|
||||
window.location.href = "/app/pong/games";
|
||||
navigateTo("/app/pong/games");
|
||||
quitChat();
|
||||
}
|
||||
break;
|
||||
|
||||
case "@ttt":
|
||||
if (msgCommand[1] === "") {
|
||||
window.location.href = "/app/ttt/games";
|
||||
navigateTo("/app/ttt/games");
|
||||
quitChat();
|
||||
}
|
||||
break;
|
||||
|
|
@ -432,12 +433,12 @@ bquit?.addEventListener("click", () => {
|
|||
});
|
||||
|
||||
myGames?.addEventListener("click", () => {
|
||||
window.location.href = "/app/pong/games";
|
||||
navigateTo("/app/pong/games");
|
||||
quitChat();
|
||||
});
|
||||
|
||||
myTTTGames?.addEventListener("click", () => {
|
||||
window.location.href = "/app/ttt/games";
|
||||
navigateTo("/app/ttt/games");
|
||||
quitChat();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import { navigateTo } from "@app/routing";
|
||||
import type { ClientProfil } from "../types_front";
|
||||
import { Socket } from "socket.io-client";
|
||||
import { quitChat } from "./quitChat";
|
||||
|
||||
/**
|
||||
* function listens for a click on the Pong Games history button
|
||||
|
|
@ -11,7 +13,8 @@ export function actionBtnPongGames(profile: ClientProfil, senderSocket: Socket)
|
|||
setTimeout(() => {
|
||||
const userGames = document.querySelector("#popup-b-hGame");
|
||||
userGames?.addEventListener("click", () => {
|
||||
window.location.href = `/app/pong/games/${profile.userID}`;
|
||||
navigateTo(`/app/pong/games/${profile.userID}`);
|
||||
quitChat();
|
||||
});
|
||||
}, 0)
|
||||
};
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
import { navigateTo } from "@app/routing";
|
||||
import type { ClientProfil } from "../types_front";
|
||||
import { Socket } from "socket.io-client";
|
||||
import { quitChat } from "./quitChat";
|
||||
|
||||
/**
|
||||
* function listens for a click on the TTT game History button
|
||||
|
|
@ -11,7 +13,8 @@ export function actionBtnTTTGames(profile: ClientProfil, senderSocket: Socket) {
|
|||
setTimeout(() => {
|
||||
const userGames = document.querySelector("#popup-b-hTGame");
|
||||
userGames?.addEventListener("click", () => {
|
||||
window.location.href = `/app/ttt/games/${profile.userID}`;
|
||||
navigateTo(`/app/ttt/games/${profile.userID}`);
|
||||
quitChat();
|
||||
});
|
||||
}, 0)
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue