fix: tournamnet: can join tournament

This commit is contained in:
2024-03-11 10:36:34 +01:00
committed by AdrienLSH
parent 1352041a19
commit ad6694f91e
4 changed files with 10 additions and 6 deletions

View File

@ -79,7 +79,7 @@ class Tourmanent
*/
async init()
{
let response = await this.client._get(`/api/tournaments/${id}`);
let response = await this.client._get(`/api/tournaments/${this.id}`);
if (response.status !== 200)
return response.status;

View File

@ -17,12 +17,12 @@ class Tourmanents
/**
*
* @param {Number} id
* @returns {?Promise<Tournament>}
* @returns {Promise<Tournament>}
*/
async getTournament(id)
{
let tournament = new Tourmanent(this.client);
if (await tournament.init(id))
let tournament = new Tourmanent(this.client, id);
if (await tournament.init())
return null;
return tournament;
}

View File

@ -55,7 +55,7 @@ export default class extends AbstractAuthenticatedView
document.getElementById("level").innerText = this.tournament.level;
document.getElementById("state").innerText = this.tournament.state;
if (this.tournament.state === "waiting")
if (this.tournament.started === false)
button.disabled = false;
}