Phase 3 and 4
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
import { useState, useEffect } from "react";
|
||||
import { getSocket } from "../lib/socket.js";
|
||||
import { useConnectivityStore } from "../store/connectivity.js";
|
||||
import type { AuctionItem, Bid, ItemState } from "@storybid/shared";
|
||||
|
||||
export interface LiveAuctionState {
|
||||
@@ -16,6 +17,7 @@ export interface LiveAuctionState {
|
||||
}
|
||||
|
||||
export function useLiveAuction(eventId: string) {
|
||||
const socketVersion = useConnectivityStore((s) => s.socketVersion);
|
||||
const [state, setState] = useState<LiveAuctionState>({
|
||||
currentItem: null,
|
||||
currentBid: null,
|
||||
@@ -74,7 +76,7 @@ export function useLiveAuction(eventId: string) {
|
||||
socket.off("item_state_changed");
|
||||
socket.off("item_sold");
|
||||
};
|
||||
}, [eventId]);
|
||||
}, [eventId, socketVersion]);
|
||||
|
||||
const placeBid = (itemId: string, amount: number, deviceId: string, clientSeq: number) => {
|
||||
const socket = getSocket();
|
||||
|
||||
Reference in New Issue
Block a user