Prévention bugs
continuous-integration/drone/push Build is passing Details

peristanceBDD
Alban GUILHOT 2 years ago
parent 2267eaa529
commit 172aeab0b5

@ -1,4 +1,4 @@
const { io } = require("socket.io-client");
export const socket = io("http://192.168.1.54:3000");
export const socket = io("http://172.20.10.2:3000");

@ -24,7 +24,9 @@ export class LoaderConversationApi implements ILoaderConversation{
url: url,
})
.then(async function (response: any) {
tabConv=await jsonToConversation(response);
if (response.data != null || response.data != undefined){
tabConv=await jsonToConversation(response);
}
});
return tabConv;
}

@ -18,29 +18,31 @@ export default class LoaderGameApi implements ILoaderGame{
})
.then(function (response: any) {
response.data.forEach(game => {
switch(game.type){
case "GameSolo":
let mapSolo = new Map();
for (let i=0; i<game.keys.length; i++){
mapSolo.set(new Number(game.keys[i]), new Number(game.values[i]))
}
tab.push(new GameSolo(game.id, game.name, game.image, game.nmbPlayerMin, game.nbPlayerMax, mapSolo));
break;
case "GameMulti":
const mapMulti = new Map();
for (let i=0; i<game.keys.length; i++){
mapMulti.set(new Number(game.keys[i]), new Number(game.values[i]));
}
tab.push(new GameMulti(game.id, game.name, game.image, game.nmbPlayerMin, game.nbPlayerMax, mapMulti));
break;
case "GameCasino":
tab.push(new GameCasino(game.id, game.name, game.image, game.nmbPlayerMin, game.nbPlayerMax));
break;
}
});
});
if (response.data != null || response.data != undefined){
response.data.forEach(game => {
switch(game.type){
case "GameSolo":
let mapSolo = new Map();
for (let i=0; i<game.keys.length; i++){
mapSolo.set(new Number(game.keys[i]), new Number(game.values[i]))
}
tab.push(new GameSolo(game.id, game.name, game.image, game.nmbPlayerMin, game.nbPlayerMax, mapSolo));
break;
case "GameMulti":
const mapMulti = new Map();
for (let i=0; i<game.keys.length; i++){
mapMulti.set(new Number(game.keys[i]), new Number(game.values[i]));
}
tab.push(new GameMulti(game.id, game.name, game.image, game.nmbPlayerMin, game.nbPlayerMax, mapMulti));
break;
case "GameCasino":
tab.push(new GameCasino(game.id, game.name, game.image, game.nmbPlayerMin, game.nbPlayerMax));
break;
}
});
}
});
return tab;
}

Loading…
Cancel
Save