mirror of
https://github.com/ershisan99/www.git
synced 2026-01-07 12:35:36 +00:00
filter user games by season in stream card component
This commit is contained in:
@@ -4,6 +4,7 @@ import { cn } from '@/lib/utils'
|
||||
import type { SelectGames } from '@/server/db/types'
|
||||
import type { LeaderboardEntry } from '@/server/services/neatqueue.service'
|
||||
import { RANKED_CHANNEL } from '@/shared/constants'
|
||||
import { filterGamesBySeason } from '@/shared/seasons'
|
||||
import { api } from '@/trpc/react'
|
||||
import { Swords } from 'lucide-react'
|
||||
import { useParams } from 'next/navigation'
|
||||
@@ -66,7 +67,8 @@ export function StreamCardClient() {
|
||||
|
||||
const [gamesQueryResult, gamesQuery] =
|
||||
api.history.user_games.useSuspenseQuery({ user_id: id })
|
||||
const games = gamesQueryResult || []
|
||||
const allGames = gamesQueryResult || []
|
||||
const games = filterGamesBySeason(allGames, 'season3')
|
||||
|
||||
const [rankedUserRank, rankedUserQuery] =
|
||||
api.leaderboard.get_user_rank.useSuspenseQuery({
|
||||
@@ -172,7 +174,8 @@ function Opponent({ id, wins }: { id: string; wins?: number }) {
|
||||
const { data: gamesQueryResult } = api.history.user_games.useQuery({
|
||||
user_id: id,
|
||||
})
|
||||
const games = gamesQueryResult || []
|
||||
const allGames = gamesQueryResult || []
|
||||
const games = filterGamesBySeason(allGames, 'season3')
|
||||
|
||||
const { data: rankedUserRank } = api.leaderboard.get_user_rank.useQuery({
|
||||
channel_id: RANKED_CHANNEL,
|
||||
|
||||
Reference in New Issue
Block a user