detail add loading
This commit is contained in:
@@ -46,7 +46,6 @@ import YouMayLike from "./YouMayLike/YouMayLike";
|
||||
|
||||
export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
const [lgCatCd, setLgCatCd] = useState("");
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [selectedIndex, setSelectedIndex] = useState(0);
|
||||
const productData = useSelector((state) => state.main.productData);
|
||||
const themeData = useSelector((state) => state.home.productData);
|
||||
@@ -259,16 +258,6 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
}
|
||||
}, [dispatch, themeProductInfos, selectedIndex, hotelInfos]);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(
|
||||
changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } })
|
||||
);
|
||||
if (productData || hotelData || themeData) {
|
||||
setLoading(false);
|
||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||
}
|
||||
}, [dispatch, productData, hotelData, themeData]);
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
dispatch(clearProductDetail());
|
||||
|
||||
Reference in New Issue
Block a user