From dea6a3d8c177a9ada48f57c747a4330cfa0fed1f Mon Sep 17 00:00:00 2001 From: Sumon Hossain Date: Mon, 12 Sep 2022 22:42:42 +0600 Subject: [PATCH] Update Video.jsx { currentVideo } is not loading properly. often resulting in errors. So I made a simple fix using the If return block --- client/src/pages/Video.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/pages/Video.jsx b/client/src/pages/Video.jsx index bcb21189e3..739693a83e 100644 --- a/client/src/pages/Video.jsx +++ b/client/src/pages/Video.jsx @@ -138,7 +138,8 @@ const Video = () => { }; fetchData(); }, [path, dispatch]); - + + if(!currentVideo) return 'loading... '; const handleLike = async () => { await axios.put(`/users/like/${currentVideo._id}`); dispatch(like(currentUser._id));