From 8cbb6aa4f63ff293a8290262f5281f33ec11f7c2 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Wed, 26 Jan 2022 11:13:31 +0530 Subject: [PATCH] mask shared-albums if not already done --- src/pages/shared-albums/index.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/pages/shared-albums/index.tsx b/src/pages/shared-albums/index.tsx index 309c0f917..d0fbdbb8d 100644 --- a/src/pages/shared-albums/index.tsx +++ b/src/pages/shared-albums/index.tsx @@ -25,6 +25,8 @@ import constants from 'utils/strings/constants'; import EnteSpinner from 'components/EnteSpinner'; import LoadingBar from 'react-top-loading-bar'; import CryptoWorker from 'utils/crypto'; +import { PAGES } from 'constants/pages'; +import router from 'next/router'; export default function PublicCollectionGallery() { const token = useRef(null); @@ -48,6 +50,21 @@ export default function PublicCollectionGallery() { const finishLoading = () => loadingBar.current?.complete(); useEffect(() => { + const currentURL = new URL(window.location.href); + if (currentURL.pathname !== PAGES.ROOT) { + router.push( + { + pathname: PAGES.SHARED_ALBUMS, + search: currentURL.search, + hash: currentURL.hash, + }, + { + pathname: PAGES.ROOT, + search: currentURL.search, + hash: currentURL.hash, + } + ); + } const main = async () => { const worker = await new CryptoWorker(); url.current = window.location.href;