chore : working on game

This commit is contained in:
2024-12-30 00:39:39 +01:00
parent 9a0c26dd80
commit 08daf733d1
5 changed files with 48 additions and 29 deletions
+13 -8
View File
@@ -11,13 +11,18 @@ async function createGame() {
return;
}
loading.value = true;
await lobbyStore.createGame().catch((e) => {
if (e.data.statusCode == 400) {
console.error("Owned game limit reached");
} else {
console.log(e);
}
});
await lobbyStore
.createGame()
.then(() => {
loading.value = false;
})
.catch((e) => {
if (e.data.statusCode == 400) {
console.error("Owned game limit reached");
} else {
console.log(e);
}
});
}
</script>
@@ -27,7 +32,7 @@ async function createGame() {
type="button"
value="Create Game"
@click="createGame"
:disabled="!userStore.self"
:disabled="!userStore.self || loading"
/>
</template>