fix: sync auction timer with server time

This commit is contained in:
dahyeon committed 2026-06-22 12:16:18 -07:00
1 parent d2fe4604dd
commit 98c2323ff2
2 files changed
+24 -1

No files matched your search

+6 -1
View File
@@ -781,9 +781,14 @@ export default function AuctionPage() {
}, [showCancelModal]);
const liveAuction = pickLatestAuction(socket.auction, auctionQuery.data);
const syncedNow = now + socket.serverTimeOffsetMs;
const auctionState =
liveAuction && matchQuery.data
? mapApiAuctionToAuctionState(liveAuction, matchQuery.data, new Date(now))
? mapApiAuctionToAuctionState(
liveAuction,
matchQuery.data,
new Date(syncedNow),
)
: null;
const availableTeamIndexes = useMemo(() => {
const indexes = new Set((auctionState?.teams ?? []).map((team) => team.teamIndex));