@@ -20,14 +20,13 @@ import { useMemory } from '@store/useMemory'
2020import { useLayoutStore } from '@store/useLayoutStore'
2121import { setDeepStore , useStorage } from '@store/useStorage'
2222import { ErrorBoundary } from '@components/ErrorBoundary'
23- import { Img , TextWithIcon } from '@components/Img'
23+ import { Img } from '@components/Img'
2424import { Title } from '@components/popups/Title'
2525import { PowerUp } from '@components/popups/PowerUp'
2626import { GenderIcon } from '@components/popups/GenderIcon'
2727import { Navigation } from '@components/popups/Navigation'
2828import { Coords } from '@components/popups/Coords'
2929import { TimeStamp } from '@components/popups/TimeStamps'
30- import { ExtraInfo } from '@components/popups/ExtraInfo'
3130import { useAnalytics } from '@hooks/useAnalytics'
3231import { getTimeUntil } from '@utils/getTimeUntil'
3332import { formatInterval } from '@utils/formatInterval'
@@ -77,16 +76,14 @@ export function GymPopup({ hasRaid, hasHatched, raidIconUrl, ...gym }) {
7776 } )
7877 }
7978
80- const now = Date . now ( )
79+ const nowSec = Math . floor ( Date . now ( ) / 1000 )
80+ const raidStart = Number ( gym . raid_spawn_timestamp ?? 0 )
81+ const raidEnd = Number ( gym . raid_end_timestamp ?? 0 )
8182
8283 const filteredRsvps =
8384 gym . rsvps ?. filter ( ( entry ) => {
84- const ets = entry . timeslot
85- return (
86- ets > now &&
87- ets / 1000 > gym . raid_spawn_timestamp &&
88- ets / 1000 < gym . raid_end_timestamp
89- )
85+ const etsSec = entry . timeslot / 1000
86+ return etsSec >= nowSec && etsSec >= raidStart && etsSec <= raidEnd
9087 } ) || [ ]
9188
9289 return (
@@ -141,7 +138,7 @@ export function GymPopup({ hasRaid, hasHatched, raidIconUrl, ...gym }) {
141138 { Boolean (
142139 gym . raid_pokemon_id && gym . raid_battle_timestamp >= ts ,
143140 ) && < Timer start { ...gym } hasHatched = { hasHatched } /> }
144- { filteredRsvps ? .length > 0 && (
141+ { filteredRsvps . length > 0 && (
145142 < Grid xs = { 12 } >
146143 < Grid
147144 container
@@ -156,7 +153,7 @@ export function GymPopup({ hasRaid, hasHatched, raidIconUrl, ...gym }) {
156153 marginBottom : 4 ,
157154 } }
158155 >
159- RSVP (Going / Maybe)
156+ < Typography variant = "subtitle1" > RSVP </ Typography >
160157 </ small >
161158 < Grid container justifyContent = "center" spacing = { 1 } >
162159 { filteredRsvps . slice ( 0 , 3 ) . map ( ( entry ) => (
@@ -1010,55 +1007,13 @@ const GymFooter = ({ lat, lon, hasRaid, gym, setShowDefenders }) => {
10101007 * @param {import('@rm/types').Gym } props
10111008 * @returns
10121009 */
1013- const ExtraGymInfo = ( {
1014- last_modified_timestamp,
1015- lat,
1016- lon,
1017- updated,
1018- total_cp,
1019- guarding_pokemon_id,
1020- guarding_pokemon_display,
1021- } ) => {
1022- const { t, i18n } = useTranslation ( )
1023- const Icons = useMemory ( ( s ) => s . Icons )
1024- const gymValidDataLimit = useMemory ( ( s ) => s . gymValidDataLimit )
1010+ const ExtraGymInfo = ( { last_modified_timestamp, lat, lon, updated } ) => {
10251011 const enableGymPopupCoords = useStorage (
10261012 ( s ) => s . userSettings . gyms . enableGymPopupCoords ,
10271013 )
10281014
1029- const numFormatter = new Intl . NumberFormat ( i18n . language )
1030- /** @type {Partial<import('@rm/types').PokemonDisplay> } */
1031- const gpd = guarding_pokemon_display || { }
1032-
10331015 return (
10341016 < Grid container alignItems = "center" justifyContent = "center" >
1035- { ! ! guarding_pokemon_id && updated > gymValidDataLimit && (
1036- < ExtraInfo title = "defender" >
1037- < TextWithIcon
1038- src = { Icons . getPokemonByDisplay ( guarding_pokemon_id , gpd ) }
1039- >
1040- { gpd . badge === 1 && (
1041- < >
1042- < Img
1043- src = { Icons . getMisc ( 'bestbuddy' ) }
1044- alt = { t ( 'best_buddy' ) }
1045- maxHeight = { 15 }
1046- maxWidth = { 15 }
1047- />
1048-
1049- </ >
1050- ) }
1051- { t ( `poke_${ guarding_pokemon_id } ` ) }
1052- </ TextWithIcon >
1053- </ ExtraInfo >
1054- ) }
1055- { ! ! total_cp && updated > gymValidDataLimit && (
1056- < ExtraInfo title = "total_cp" > { numFormatter . format ( total_cp ) } </ ExtraInfo >
1057- ) }
1058- < Divider
1059- flexItem
1060- style = { { width : '100%' , height : 2 , margin : '10px 0' } }
1061- />
10621017 < TimeStamp time = { updated } > last_seen</ TimeStamp >
10631018 < TimeStamp time = { last_modified_timestamp } > last_modified</ TimeStamp >
10641019 { enableGymPopupCoords && (
0 commit comments