Skip to content

Commit

Permalink
Update SocialSharing.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
UnaiEtxaburu authored Oct 30, 2024
1 parent d9a1ebd commit 6f2635e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SocialSharing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ const SocialSharing = ({
}) => {
const [currentUrl, setCurrentUrl] = useState('');
const [display, setDisplay] = useState(true);
const pathName = location.pathname;
const pathName = location?.pathname;

useEffect(() => {
setCurrentUrl(window.location.href);
}, []);

// Disable sharing on non content routes
useEffect(() => {
setDisplay(!isCmsUi(pathName));
pathName && setDisplay(!isCmsUi(pathName));
}, [pathName]);

// MOBILE checker
Expand Down

0 comments on commit 6f2635e

Please sign in to comment.