reza added some change now

master
RezaAshrafi77 3 years ago
parent 8c8be6e2e6
commit 3661f6c42d
  1. 10
      src/views/Course/index.tsx
  2. 8
      src/views/VideoTube/index.tsx

@ -10,6 +10,7 @@ import slide from "../../assets/icons/slide.png";
import play from "../../assets/icons/play.png"; import play from "../../assets/icons/play.png";
import bookmark from "../../assets/icons/bookmark.png"; import bookmark from "../../assets/icons/bookmark.png";
import StyledRating from "../../components/StyledRating"; import StyledRating from "../../components/StyledRating";
import location from "../../util/location";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { publicApi } from "../../redux/actions"; import { publicApi } from "../../redux/actions";
import scroll from "../../util/scroll"; import scroll from "../../util/scroll";
@ -25,19 +26,14 @@ function Course({ getInfo, info, categories, loading }: any) {
useEffect(() => { useEffect(() => {
scroll.goToTop(); scroll.goToTop();
getInfo({ getInfo({
bookId: 18, bookId: location.getId()
// window.location.pathname.slice(
// window.location.pathname.lastIndexOf("/") + 1,
// window.location.pathname.length
// ),
}); });
}, []); }, []);
const checkFreeCat = () => { const checkFreeCat = () => {
const freeCat = info?.vods.filter((item: any) => item?.isFreeVOD)[0]; const freeCat = info?.vods.filter((item: any) => item?.isFreeVOD)[0];
localStorage.setItem("free", 1 + "," + freeCat?.categoryId); localStorage.setItem("free", location.getId() + "," + freeCat?.categoryId);
}; };
return ( return (
<div <div
className="course main d-flex flex-column" className="course main d-flex flex-column"

@ -122,10 +122,10 @@ function VodTube({ selectedVideo, info, bookSection, loading }: any) {
<Footer /> <Footer />
</div> </div>
{loading && ( {loading && (
<div className="full-loader"> <div className="full-loader">
<Loader size={50} /> <Loader size={50} />
</div> </div>
)} )}
</> </>
); );
} }

Loading…
Cancel
Save