mirror of
https://github.com/ershisan99/www.git
synced 2025-12-17 21:09:22 +00:00
fix caching
This commit is contained in:
@@ -241,7 +241,7 @@ function LeaderboardTable({
|
|||||||
const virtualRows = rowVirtualizer.getVirtualItems()
|
const virtualRows = rowVirtualizer.getVirtualItems()
|
||||||
console.log({ virtualRows })
|
console.log({ virtualRows })
|
||||||
console.log(rowVirtualizer.getTotalSize())
|
console.log(rowVirtualizer.getTotalSize())
|
||||||
const paddingTop = virtualRows.length > 0 ? virtualRows?.[0]?.start : 0
|
const paddingTop = virtualRows.length > 0 ? (virtualRows?.[0]?.start ?? 0) : 0
|
||||||
const paddingBottom =
|
const paddingBottom =
|
||||||
virtualRows.length > 0
|
virtualRows.length > 0
|
||||||
? rowVirtualizer.getTotalSize() -
|
? rowVirtualizer.getTotalSize() -
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { createTRPCRouter, publicProcedure } from '@/server/api/trpc'
|
import { createTRPCRouter, publicProcedure } from '@/server/api/trpc'
|
||||||
import { LeaderboardService } from '@/server/services/leaderboard'
|
import { LeaderboardService } from '@/server/services/leaderboard'
|
||||||
import type { LeaderboardResponse } from '@/server/services/neatqueue.service'
|
import type { LeaderboardEntry } from '@/server/services/neatqueue.service'
|
||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
const service = new LeaderboardService()
|
const service = new LeaderboardService()
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ export const leaderboard_router = createTRPCRouter({
|
|||||||
.query(async ({ input }) => {
|
.query(async ({ input }) => {
|
||||||
return (await service.getLeaderboard(
|
return (await service.getLeaderboard(
|
||||||
input.channel_id
|
input.channel_id
|
||||||
)) as LeaderboardResponse['alltime']
|
)) as LeaderboardEntry[]
|
||||||
}),
|
}),
|
||||||
get_user_rank: publicProcedure
|
get_user_rank: publicProcedure
|
||||||
.input(
|
.input(
|
||||||
|
|||||||
@@ -57,11 +57,16 @@ export type Data = {
|
|||||||
winrate: number
|
winrate: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type LeaderboardEntry = {
|
export type LeaderboardEntryInternal = {
|
||||||
id: string
|
id: string
|
||||||
data: Data
|
data: Data
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
export type LeaderboardResponse = {
|
export type LeaderboardResponse = {
|
||||||
alltime: LeaderboardEntry[]
|
alltime: LeaderboardEntryInternal[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type LeaderboardEntry = Data & {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user