From d1d281b27a3a3cb82141df5360c8514137df85dc Mon Sep 17 00:00:00 2001 From: Sumon Hossain Date: Mon, 12 Sep 2022 22:36:13 +0600 Subject: [PATCH] Update Video.jsx { currentUser } 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, 3 insertions(+) diff --git a/client/src/pages/Video.jsx b/client/src/pages/Video.jsx index bcb21189e3..9fd595cff7 100644 --- a/client/src/pages/Video.jsx +++ b/client/src/pages/Video.jsx @@ -138,6 +138,9 @@ const Video = () => { }; fetchData(); }, [path, dispatch]); + + if(!currentUser) return 'Loading....'; + const handleLike = async () => { await axios.put(`/users/like/${currentVideo._id}`);