Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Mar 4, 2022
2 parents c770b6d + 4b0a962 commit 5af29bd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ try {
metafile: true,
minify: isRelease || !isDevelopment,
logLevel: isDevelopment ? 'info' : 'error',
target: [
'safari11',
'chrome64',
'firefox58',
'edge88',
],
watch: isDevelopment
? {
onRebuild(error) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reactmap",
"version": "1.1.0",
"version": "1.1.1",
"description": "React based frontend map.",
"main": "index.js",
"author": "TurtIeSocks <[email protected]>",
Expand Down
6 changes: 4 additions & 2 deletions server/src/models/Gym.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ module.exports = class Gym extends Model {

queryResults.forEach(gym => {
const newGym = Object.fromEntries(coreFields.map(field => [field, gym[field]]))
const isEgg = gym.raid_battle_timestamp > safeTs || (gym.raid_end_timestamp > safeTs && !gym.raid_pokemon_id)
const isRaid = gym.raid_end_timestamp > safeTs
const isEgg = isRaid && !gym.raid_pokemon_id

if (userBadgeObj[gym.id]) {
newGym.badge = userBadgeObj[gym.id]
Expand All @@ -243,7 +243,9 @@ module.exports = class Gym extends Model {
raidFields.forEach(field => newGym[field] = gym[field])
newGym.hasRaid = true
}
if (newGym.hasRaid || newGym.badge || finalTeams.includes(gym.team_id) || finalSlots[gym.team_id]?.includes(gym.available_slots)) {
if (newGym.hasRaid || newGym.badge
|| finalTeams.includes(gym.team_id)
|| finalSlots[gym.team_id]?.includes(gym.available_slots)) {
filteredResults.push(newGym)
}
})
Expand Down
5 changes: 2 additions & 3 deletions server/src/models/Pokestop.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ module.exports = class Pokestop extends Model {
}

static get idColumn() {
return dbSelection('pokestop') === 'mad'
? 'pokestop_id' : 'id'
return type === 'mad' ? 'pokestop_id' : 'id'
}

static async getAllPokestops(args, perms, isMad) {
Expand Down Expand Up @@ -539,8 +538,8 @@ module.exports = class Pokestop extends Model {
Object.entries(stops).forEach(stopType => {
const [sType, rewards] = stopType
switch (sType) {
default: rewards.forEach(reward => finalList.add(`i${reward.grunt_type}`)); break
case 'lures': rewards.forEach(reward => finalList.add(`l${reward.lure_id}`)); break
default: rewards.forEach(reward => finalList.add(`i${reward.grunt_type}`)); break
}
})
return [...finalList]
Expand Down

0 comments on commit 5af29bd

Please sign in to comment.