Skip to content

Commit

Permalink
removed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
varCepheid committed Nov 9, 2023
1 parent 235dbb5 commit c515dce
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 28 deletions.
14 changes: 0 additions & 14 deletions src/routes/event-team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ import IconButton from '@/components/icon-button'
import { EventTeamInfo } from '@/api/event-team-info'
import { Heading } from '@/components/heading'

/* const sectionStyle = css`
font-weight: normal;
text-align: center;
font-size: 1.2rem;
` */

interface Props {
eventKey: string
teamNum: string
Expand All @@ -61,8 +55,6 @@ const queueDuration = 20 * minute
const isCurrent = (now: Date) => (match: ProcessedMatchInfo): boolean => {
const matchStartTime = match.time
if (!matchStartTime) return false
// match starts at 3:04
// match is current till 3:11 (+7m)
const matchEndTime = new Date(matchStartTime.getTime() + matchCycleDuration)
return matchStartTime < now && now < matchEndTime
}
Expand Down Expand Up @@ -109,9 +101,6 @@ const guessTeamLocation = (
if (!m.time) return false

const matchStartTime = m.time.getTime()
// match starts at 3:04
// match queueing starts at 2:39
// verify that 2:39 < now < 3:04
const matchQueueStartTime = matchStartTime - queueDuration
return matchQueueStartTime < currentTime && currentTime < matchStartTime
})
Expand All @@ -122,9 +111,6 @@ const guessTeamLocation = (
if (!m.time) return false
const matchStartTime = m.time.getTime()
const matchEndTime = matchStartTime + matchCycleDuration
// match started at 3:04
// match ended at 3:11 (+7m)
// verify that 3:11 < now < 3:21 (+10m)
return (
matchEndTime < currentTime &&
currentTime < matchEndTime + afterMatchDuration
Expand Down
3 changes: 0 additions & 3 deletions src/routes/event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ const Event = ({ eventKey }: Props) => {
const eventInfo = useEventInfo(eventKey)

const currentTime = useCurrentTime().getTime()
// const date = new Date(2022, 2, 25, 15)
// const currentTime = date.getTime()
// These lines were used for testing. This was the most obvious way to manually set a date.
const upcomingMatches = matches
? getUpcomingMatches(matches, currentTime)
: []
Expand Down
12 changes: 1 addition & 11 deletions src/utils/upcoming-matches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,9 @@ export const getUpcomingMatches = (
matches: ProcessedMatchInfo[],
currentTime: number,
) => {
/* matches.reduce<ProcessedMatchInfo | null>((prev, match) => {
// if match has started, it is not a candidate
if (!match.time || match.time.getTime() < useCurrentTime().getTime())
return prev
// nothing to compare against so this one must be the best so far
if (!prev) return match
return compareMatches(prev, match) > 0 ? match : prev
}, null) */
const retArr = []
for (const match of matches) {
/* if (match.redScore) {
retArr = []
} else */ if (
if (
match.time &&
match.time.getTime() < currentTime + 1000 * 60 * 15 &&
match.time.getTime() > currentTime - 1000 * 60 * 4
Expand Down

0 comments on commit c515dce

Please sign in to comment.