ft_transcendence/frontend/static/js/views/MatchMakingView.js

30 lines
522 B
JavaScript
Raw Permalink Normal View History

2023-12-12 06:06:13 -05:00
import { client, navigateTo } from "../index.js";
import AbstractView from "./abstracts/AbstractView.js";
2023-12-11 07:40:01 -05:00
2023-12-12 06:06:13 -05:00
function game_found(game_id)
{
navigateTo(`/games/${game_id}`)
}
2023-12-11 07:40:01 -05:00
export default class extends AbstractView {
constructor(params) {
super(params, "Dashboard");
}
2023-12-12 06:06:13 -05:00
async postInit()
{
await client.matchmaking.start(game_found)
}
2023-12-11 07:40:01 -05:00
async getHtml() {
return `
<h1>finding<h1>
`;
}
2023-12-12 06:06:13 -05:00
async leavePage()
{
await client.matchmaking.stop();
}
}