Skip to content

Commit

Permalink
Fix undefined/null display issue for raid re-scan gap. (#2453)
Browse files Browse the repository at this point in the history
* fix for issue raid timing gap
  • Loading branch information
BrownSlaughter authored and sebastienvercammen committed Jan 23, 2018
1 parent b0937fb commit d75cd4d
Showing 1 changed file with 31 additions and 19 deletions.
50 changes: 31 additions & 19 deletions static/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -721,29 +721,41 @@ function gymLabel(gym, includeMembers = true) {
} else {
raidImage = `<img class='gym sprite' src='static/images/raid/${gymTypes[gym.team_id]}_${raid.level}_unknown.png'>`
}
image = `
<div class='raid container'>
<div class='raid container content-left'>
<div>
if (raid.pokemon_id === null) {
image = `
${raidImage}
<div class='raid'>
<span style='color:rgb(${raidColor[Math.floor((raid.level - 1) / 2)]})'>
${levelStr}
</span>
<span class='raid countdown label-countdown' disappears-at='${raid.end}'></span> left (${moment(raid.end).format('HH:mm')})
</div>
</div>
<div class='raid container content-right'>
<div>
<div class='raid pokemon'>
${raid['pokemon_name']} <a href='http://pokemon.gameinfo.io/en/pokemon/${raid['pokemon_id']}' target='_blank' title='View in Pok茅dex'>#${raid['pokemon_id']}</a> | CP: ${raid['cp']}
</div>
${raidStr}
`
} else {
image = `
<div class='raid container'>
<div class='raid container content-left'>
<div>
${raidImage}
</div>
</div>
<div class='raid container content-right'>
<div>
<div class='raid pokemon'>
${raid['pokemon_name']} <a href='http://pokemon.gameinfo.io/en/pokemon/${raid['pokemon_id']}' target='_blank' title='View in Pok茅dex'>#${raid['pokemon_id']}</a> | CP: ${raid['cp']}
</div>
${raidStr}
</div>
</div>
</div>
<div class='raid'>
<span style='color:rgb(${raidColor[Math.floor((raid.level - 1) / 2)]})'>
${levelStr}
</span>
<span class='raid countdown label-countdown' disappears-at='${raid.end}'></span> left (${moment(raid.end).format('HH:mm')})
</div>
</div>
<div class='raid'>
<span style='color:rgb(${raidColor[Math.floor((raid.level - 1) / 2)]})'>
${levelStr}
</span>
<span class='raid countdown label-countdown' disappears-at='${raid.end}'></span> left (${moment(raid.end).format('HH:mm')})
</div>
`
`
}
} else {
image = `<img class='gym sprite' src='static/images/gym/${gymTypes[gym.team_id]}_${getGymLevel(gym)}_${raid.level}.png'>`
}
Expand Down

0 comments on commit d75cd4d

Please sign in to comment.