30 lines
552 B
JavaScript
30 lines
552 B
JavaScript
import { client, navigateTo } from "../index.js";
|
|
import AbstractView from "./AbstractView.js";
|
|
|
|
function game_found(game_id)
|
|
{
|
|
navigateTo(`/games/${game_id}`)
|
|
}
|
|
|
|
export default class extends AbstractView {
|
|
constructor(params) {
|
|
super(params, "Dashboard");
|
|
}
|
|
|
|
async postInit()
|
|
{
|
|
await client.matchmaking.start(game_found)
|
|
console.log("start matchmaking")
|
|
}
|
|
|
|
async getHtml() {
|
|
return `
|
|
<h1>finding<h1>
|
|
`;
|
|
}
|
|
|
|
async leavePage()
|
|
{
|
|
await client.matchmaking.stop();
|
|
}
|
|
} |