quelques changements mineur et d'améklioration du code

This commit is contained in:
batche
2022-12-23 13:14:28 +01:00
parent 4c6f832252
commit 2386a793cd
8 changed files with 73 additions and 148 deletions

View File

@@ -82,7 +82,8 @@
const responseInjson = await responseFromServer.json();
const token : string = responseInjson.token;
showWaitPage = false;
if (!responseFromServer.ok || (responseFromServer.status != 200 && responseFromServer.status != 201))
console.log("status : " + responseFromServer.status)
if (responseFromServer.status != 200)
{
console.log(responseInjson)
console.log("On refuse le ticket");
@@ -137,10 +138,12 @@
clearInterval(idOfIntevalCheckTerminationOfTheMatch);
console.log("matchTermitation was called")
showWaitPage = false
matchAbort ? errorMessageWhenAttemptingToGetATicket = "The match has been aborted" : errorMessageWhenAttemptingToGetATicket = "The match is finished !"
matchAbort ?
errorMessageWhenAttemptingToGetATicket = "The match has been aborted"
: errorMessageWhenAttemptingToGetATicket = "The match is finished !"
matchAbort ? showError = true : showMatchEnded = true;
hiddenGame = true;
setTimeout(() => {
hiddenGame = true;
showError = false;
showMatchEnded = false;
optionsAreNotSet = true
@@ -216,25 +219,22 @@
Might become useless after CSS rework. -->
<div id="game_page">
<div id="canvas_container" hidden={hiddenGame}>
<canvas id={gameAreaId}/>
</div>
{#if showError === true}
<div id="div_game" in:fly="{{ y: 10, duration: 1000 }}">
<fieldset>
<legend>Error</legend>
<p>{errorMessageWhenAttemptingToGetATicket}</p>
<button id="pong_button">Retry</button>
</fieldset>
</div>
{/if}
{#if showMatchEnded === true}
<div id="div_game" in:fly="{{ y: 10, duration: 1000 }}">
<p>{errorMessageWhenAttemptingToGetATicket}</p>
</div>
{/if}
{#if showError === true}
<div id="div_game" in:fly="{{ y: 10, duration: 1000 }}">
<fieldset>
<legend>Error</legend>
<p>{errorMessageWhenAttemptingToGetATicket}</p>
</fieldset>
</div>
{/if}
<div id="canvas_container" hidden={hiddenGame}>
<canvas id={gameAreaId}/>
</div>
{#if showWaitPage === true}
<div id="div_game" in:fly="{{ y: 10, duration: 1000 }}">