Skip to content

Commit

Permalink
useInterval, not useTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
swantzter committed Sep 13, 2023
1 parent 36ccf8a commit c1b24cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/views/Leaderboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import { useRouteParams, useRouteQuery } from '@vueuse/router'
import { useLeaderboardQuery, useHeatChangedSubscription, CategoryType, type TeamFragment, ResultVersionType } from '../graphql/generated'

Check failure on line 71 in src/views/Leaderboard.vue

View workflow job for this annotation

GitHub Actions / lint

Import "ResultVersionType" is only used as types
import { computed, ref, watch } from 'vue'
import { parseCompetitionEventDefinition, type EntryResult, type TableHeader, type OverallResult } from '@ropescore/rulesets'
import { useTimeoutFn } from '@vueuse/core'
import { useIntervalFn } from '@vueuse/core'
import { useCompetitionEvent } from '../hooks/ruleset'
import { formatList } from '../helpers'
Expand All @@ -93,7 +93,7 @@ const heatChangeSubscription = useHeatChangedSubscription({
watch(heatChangeSubscription.result, result => {
leaderboardQuery.refetch()
})
useTimeoutFn(() => {
useIntervalFn(() => {
if (typeof leaderboardQuery.result.value?.group?.currentHeat !== 'number') leaderboardQuery.refetch()
}, 60_000)
Expand Down Expand Up @@ -141,7 +141,7 @@ watch(rankedResults, newRankedResults => {
}
})
useTimeoutFn(() => {
useIntervalFn(() => {
const idx = selectedResult.value == null ? -1 : resultsToCycle.value.indexOf(selectedResult.value)
if (resultsToCycle.value[idx + 1] == null) selectedResult.value = resultsToCycle.value[0]
else selectedResult.value = resultsToCycle.value[idx + 1]
Expand Down

0 comments on commit c1b24cc

Please sign in to comment.