Skip to content

Commit

Permalink
fix: couple of queries
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Mar 6, 2024
1 parent 6f06b4f commit 460f66e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/features/pokemon/PokemonPopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ const leagueLookup = {
master: '9000',
}

/** @param {number} ivPercent */
const getColor = (ivPercent) => {
switch (true) {
case ivPercent < 50:
return 'error.main'
case ivPercent < 80:
case ivPercent < 51:
return 'error.dark'
case ivPercent < 66:
return 'error.light'
case ivPercent < 82:
return 'warning.main'
case ivPercent < 100:
return 'info.main'
Expand Down Expand Up @@ -377,7 +380,7 @@ const Timer = ({ pokemon, hasStats, t }) => {
{timer.str}
</Typography>
<Typography variant="subtitle2" align="center">
{despawnTimer.toLocaleString(
{new Date(despawnTimer).toLocaleTimeString(
localStorage.getItem('i18nextLng') || 'en',
)}
</Typography>
Expand Down
4 changes: 2 additions & 2 deletions src/services/queries/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class Query {
Events: filters.eventStops && perms.eventStops,
})

if (query === 'GET') query += 'POKESTOPS'
if (query === 'GET') query += '_POKESTOPS'
return pokestopIndex[query]
}

Expand All @@ -101,7 +101,7 @@ export class Query {
Ivs: perms.iv,
Pvp: perms.pvp,
})
if (query === 'GET') query += 'POKEMON'
if (query === 'GET') query += '_POKEMON'

return pokemonIndex[query]
}
Expand Down

0 comments on commit 460f66e

Please sign in to comment.