fix: sync auction timer with server time
This commit is contained in:
1 parent
d2fe4604dd
commit
98c2323ff2
2 files changed
+24
-1
No files matched your search
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user