Skip to content

Commit

Permalink
fix(old-front): Maintain the old front for the survivors fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
leonard-IMBERT committed Apr 5, 2019
1 parent a7ddb9d commit 178048d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/front/front.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function fetchTurn() {
function getSurvivors(point?: { x: number, y: number }) {
return ((point ? fetch(Requests.InfoRequest(point.x, point.y)) : fetch(Requests.AllInfoRequest()))
.then(d => d.json())
.then((d) => {
.then((dat) => {
// Cleaning the search
inputSearch.value = '';

Expand All @@ -41,6 +41,12 @@ function getSurvivors(point?: { x: number, y: number }) {
}
cards = [];

let d;
if (dat instanceof Array) {
d = dat;
} else {
d = dat.Survivors;
}

// Populating the data
d.forEach((inhab: any) => {
Expand Down

0 comments on commit 178048d

Please sign in to comment.