throttle 'tilts' from the server
This commit is contained in:
@@ -22,7 +22,7 @@ type CardProps = {
|
||||
|
||||
export default function Card({ card, cardIndex }: CardProps) {
|
||||
const [tooltip, setTooltip] = useState<React.ReactNode>(null);
|
||||
const { flipCard, gameData, redraw, setSelectCardIndex } = useAppContext();
|
||||
const { emitFlip, gameData, emitRedraw, setSelectCardIndex } = useAppContext();
|
||||
|
||||
const { dmID, settings } = gameData;
|
||||
const isDM = !!dmID;
|
||||
@@ -32,7 +32,7 @@ export default function Card({ card, cardIndex }: CardProps) {
|
||||
|
||||
const handleClick = () => {
|
||||
if (isDM) {
|
||||
flipCard(cardIndex);
|
||||
emitFlip(cardIndex);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -79,7 +79,7 @@ export default function Card({ card, cardIndex }: CardProps) {
|
||||
/>
|
||||
{isDM && !flipped && (
|
||||
<StackTheDeck
|
||||
onRedraw={() => redraw(cardIndex)}
|
||||
onRedraw={() => emitRedraw(cardIndex)}
|
||||
onSelect={() => setSelectCardIndex(cardIndex)}
|
||||
onHover={setTooltip}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user