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"); 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, url: url,
}) })
.then(async function (response: any) { .then(async function (response: any) {
tabConv=await jsonToConversation(response); if (response.data != null || response.data != undefined){
tabConv=await jsonToConversation(response);
}
}); });
return tabConv; return tabConv;
} }

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

Loading…
Cancel
Save