Skip to content

Commit

Permalink
fix(web/InventorySlot): incorrect types used for timer (#1678)
Browse files Browse the repository at this point in the history
  • Loading branch information
T-001v2r3 authored May 9, 2024
1 parent 08d8ba3 commit 7e688e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/src/components/inventory/InventorySlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const InventorySlot: React.ForwardRefRenderFunction<HTMLDivElement, SlotProps> =
) => {
const manager = useDragDropManager();
const dispatch = useAppDispatch();
const timerRef = useRef<NodeJS.Timer | null>(null);
const timerRef = useRef<number | null>(null);

const canDrag = useCallback(() => {
return canPurchaseItem(item, { type: inventoryType, groups: inventoryGroups }) && canCraftItem(item, inventoryType);
Expand Down Expand Up @@ -139,9 +139,9 @@ const InventorySlot: React.ForwardRefRenderFunction<HTMLDivElement, SlotProps> =
<div
className="item-slot-wrapper"
onMouseEnter={() => {
timerRef.current = setTimeout(() => {
timerRef.current = window.setTimeout(() => {
dispatch(openTooltip({ item, inventoryType }));
}, 500);
}, 500) as unknown as number;
}}
onMouseLeave={() => {
dispatch(closeTooltip());
Expand Down

0 comments on commit 7e688e7

Please sign in to comment.