Skip to content

Commit 1ece213

Browse files
committed
fix: ✏️ Add missing constant - loading
1 parent 81508ce commit 1ece213

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/pages/products/[id].tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function ProductDetailsPage(): React.JSX.Element | null {
2121

2222
const [quantity, setQuantity] = useState<number>(INITIAL_ITEM_COUNT);
2323

24-
const { data } = useProductByIdService(+id!);
24+
const { data, isLoading } = useProductByIdService(+id!);
2525
const { dispatch } = useContext(ShoppingCartContext);
2626

2727
const specifications = useMemo(() => ([
@@ -60,7 +60,7 @@ export default function ProductDetailsPage(): React.JSX.Element | null {
6060
setQuantity(INITIAL_ITEM_COUNT);
6161
}
6262

63-
if (!data) {
63+
if (!data || isLoading) {
6464
return null;
6565
}
6666

0 commit comments

Comments
 (0)