diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 4104d38d7..c0ced3619 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -119,23 +119,11 @@ export default function LandingPage() { }, []); const handleAlbumsRedirect = async (currentURL: URL) => { - await router.push({ + await router.replace({ pathname: PAGES.SHARED_ALBUMS, search: currentURL.search, hash: currentURL.hash, }); - await router.push( - { - pathname: PAGES.SHARED_ALBUMS, - search: currentURL.search, - hash: currentURL.hash, - }, - { - pathname: PAGES.ROOT, - search: currentURL.search, - hash: currentURL.hash, - } - ); await initLocalForage(); }; diff --git a/src/pages/shared-albums/index.tsx b/src/pages/shared-albums/index.tsx index 11bf8f730..f737a4bc9 100644 --- a/src/pages/shared-albums/index.tsx +++ b/src/pages/shared-albums/index.tsx @@ -27,7 +27,7 @@ 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'; +import { useRouter } from 'next/router'; const Loader = () => ( @@ -51,6 +51,7 @@ export default function PublicCollectionGallery() { const closeReportForm = () => setAbuseReportFormView(false); const loadingBar = useRef(null); const isLoadingBarRunning = useRef(false); + const router = useRouter(); const openMessageDialog = () => setMessageDialogView(true); const closeMessageDialog = () => setMessageDialogView(false); @@ -68,7 +69,7 @@ export default function PublicCollectionGallery() { appContext.showNavBar(true); const currentURL = new URL(window.location.href); if (currentURL.pathname !== PAGES.ROOT) { - router.push( + router.replace( { pathname: PAGES.SHARED_ALBUMS, search: currentURL.search, @@ -78,6 +79,9 @@ export default function PublicCollectionGallery() { pathname: PAGES.ROOT, search: currentURL.search, hash: currentURL.hash, + }, + { + shallow: true, } ); } @@ -140,7 +144,7 @@ export default function PublicCollectionGallery() { collectionKey.current ); setPublicCollection(null); - setPublicFiles([]); + setPublicFiles(null); } } finally { finishLoadingBar(); @@ -150,7 +154,7 @@ export default function PublicCollectionGallery() { if (!publicFiles && loading) { return ; } - if (!publicFiles?.length && !loading) { + if (!publicFiles && !loading) { return {constants.NOT_FOUND}; } diff --git a/src/utils/strings/englishConstants.tsx b/src/utils/strings/englishConstants.tsx index 494be4f30..cec9704f5 100644 --- a/src/utils/strings/englishConstants.tsx +++ b/src/utils/strings/englishConstants.tsx @@ -99,7 +99,7 @@ const englishConstants = { ENTER_ALBUM_NAME: 'album name', CLOSE: 'close', NO: 'no', - NOTHING_HERE: 'nothing to see here, yet', + NOTHING_HERE: 'nothing to see here eyes 👀', UPLOAD: { 0: 'preparing to upload', 1: 'reading google metadata files', @@ -609,7 +609,7 @@ const englishConstants = { OPEN_PLAN_SELECTOR_MODAL_FAILED: 'failed to open plans', COMMENT: 'comment', ABUSE_REPORT_DESCRIPTION: - 'Note: Submitting this report will notify the album owner.', + 'submitting this report will notify the album owner.', OTHER_REASON_REQUIRES_COMMENTS: 'reason = other, require a mandatory comment ', REPORT_SUBMIT_SUCCESS_CONTENT: 'your report has been submitted',