mirror of
https://github.com/ershisan99/www.git
synced 2025-12-17 12:34:17 +00:00
debug 500 error on stream card refresh
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
import { RANKED_CHANNEL } from '@/shared/constants'
|
||||
import { api } from '@/trpc/react'
|
||||
import { ArrowDown, ArrowUp } from 'lucide-react'
|
||||
import { useParams } from 'next/navigation'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
@@ -29,7 +28,7 @@ export function StreamCardClient() {
|
||||
rankedUserQuery.refetch()
|
||||
},
|
||||
// 1 minute
|
||||
1000 * 60 * 1
|
||||
1000 * 1
|
||||
)
|
||||
}, [])
|
||||
|
||||
@@ -73,7 +72,7 @@ export function StreamCardClient() {
|
||||
meaningful_games > 0 ? Math.floor((losses / meaningful_games) * 100) : 0,
|
||||
rank: rankedUserRank.rank,
|
||||
mmr: Math.round(rankedUserRank.mmr),
|
||||
mmrChange: `${(lastGame?.mmrChange ?? 0) >= 0 ? '+' : '-'}${Math.round(lastGame?.mmrChange ?? 0)}`,
|
||||
mmrChange: `${(lastGame?.mmrChange ?? 0) >= 0 ? '+' : ''}${Math.round(lastGame?.mmrChange ?? 0)}`,
|
||||
streak: rankedUserRank?.streak,
|
||||
}
|
||||
return (
|
||||
|
||||
@@ -14,11 +14,14 @@ export const history_router = createTRPCRouter({
|
||||
})
|
||||
)
|
||||
.query(async ({ ctx, input }) => {
|
||||
return await ctx.db
|
||||
const res = await ctx.db
|
||||
.select()
|
||||
.from(player_games)
|
||||
.where(eq(player_games.playerId, input.user_id))
|
||||
.orderBy(desc(player_games.gameNum))
|
||||
|
||||
console.log('history.user_games', res)
|
||||
return res
|
||||
}),
|
||||
sync: publicProcedure.mutation(async () => {
|
||||
return syncHistory()
|
||||
|
||||
@@ -24,6 +24,8 @@ export const leaderboard_router = createTRPCRouter({
|
||||
})
|
||||
)
|
||||
.query(async ({ input }) => {
|
||||
return await service.getUserRank(input.channel_id, input.user_id)
|
||||
const res = await service.getUserRank(input.channel_id, input.user_id)
|
||||
console.log('leaderboard.get_user_rank', res)
|
||||
return res
|
||||
}),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user