feat: Update routing and websocket configuration for game state management
This commit is contained in:
@@ -18,14 +18,15 @@ export const useUserInfo = defineStore('userInfo', () => {
|
||||
gameId.value = id;
|
||||
}
|
||||
|
||||
function requestState() {
|
||||
axios.get(`${api}/status`, {withCredentials: true}).then((response) => {
|
||||
async function requestState() {
|
||||
await axios.get(`${api}/status`, {withCredentials: true}).then((response) => {
|
||||
console.log("STATUS DATA:" + response.data.status + response.data.inGame)
|
||||
username.value = response.data.username;
|
||||
if (response.data.ingame) {
|
||||
if (response.data.gameId) {
|
||||
console.log("GAMEID:" + response.data.gameId)
|
||||
gameId.value = response.data.gameId;
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function clearUserInfo() {
|
||||
|
||||
Reference in New Issue
Block a user