From a3235967e350b931c4ed6841c9dbe1a0c84b20b8 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Wed, 2 Feb 2022 22:01:01 +0530 Subject: [PATCH 1/6] nothing to see here if files is empty --- src/pages/shared-albums/index.tsx | 4 ++-- src/utils/strings/englishConstants.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/shared-albums/index.tsx b/src/pages/shared-albums/index.tsx index 11bf8f730..eef11ab3f 100644 --- a/src/pages/shared-albums/index.tsx +++ b/src/pages/shared-albums/index.tsx @@ -140,7 +140,7 @@ export default function PublicCollectionGallery() { collectionKey.current ); setPublicCollection(null); - setPublicFiles([]); + setPublicFiles(null); } } finally { finishLoadingBar(); @@ -150,7 +150,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..c6c5ea27d 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', From 5c62a3183d32963c2916dbbe60ae4df47c80e18b Mon Sep 17 00:00:00 2001 From: Abhinav Date: Wed, 2 Feb 2022 22:01:58 +0530 Subject: [PATCH 2/6] update ABUSE_REPORT_DESCRIPTION --- src/utils/strings/englishConstants.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/strings/englishConstants.tsx b/src/utils/strings/englishConstants.tsx index c6c5ea27d..cec9704f5 100644 --- a/src/utils/strings/englishConstants.tsx +++ b/src/utils/strings/englishConstants.tsx @@ -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', From be5e1d96ef83ba53394b31c87d30c57a1253d57c Mon Sep 17 00:00:00 2001 From: Abhinav Date: Wed, 2 Feb 2022 22:09:51 +0530 Subject: [PATCH 3/6] remove album url label and add spacing after form description --- src/components/pages/sharedAlbum/AbuseReportForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/pages/sharedAlbum/AbuseReportForm.tsx b/src/components/pages/sharedAlbum/AbuseReportForm.tsx index 262b588a7..f9c8d94ae 100644 --- a/src/components/pages/sharedAlbum/AbuseReportForm.tsx +++ b/src/components/pages/sharedAlbum/AbuseReportForm.tsx @@ -106,6 +106,7 @@ export function AbuseReportForm({ show, close, url }: Iprops) { }}>
{constants.ABUSE_REPORT_DESCRIPTION}
+
initialValues={{ ...defaultInitialValues, @@ -169,7 +170,6 @@ export function AbuseReportForm({ show, close, url }: Iprops) { }): JSX.Element => (
- {constants.ALBUM_URL} Date: Thu, 3 Feb 2022 09:46:15 +0530 Subject: [PATCH 4/6] replcae push with replace when routing to shared-albums --- src/pages/index.tsx | 4 ++-- src/pages/shared-albums/index.tsx | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 4104d38d7..7f67d54bf 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -119,12 +119,12 @@ 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( + await router.replace( { pathname: PAGES.SHARED_ALBUMS, search: currentURL.search, diff --git a/src/pages/shared-albums/index.tsx b/src/pages/shared-albums/index.tsx index eef11ab3f..3cd467cdc 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, From 6355f01e967f69f15d025e0009bf3345d06acf5e Mon Sep 17 00:00:00 2001 From: Abhinav Date: Thu, 3 Feb 2022 09:51:12 +0530 Subject: [PATCH 5/6] better handle routing with shallow replacing --- src/pages/index.tsx | 12 ------------ src/pages/shared-albums/index.tsx | 3 +++ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 7f67d54bf..c0ced3619 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -124,18 +124,6 @@ export default function LandingPage() { search: currentURL.search, hash: currentURL.hash, }); - await router.replace( - { - 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 3cd467cdc..f737a4bc9 100644 --- a/src/pages/shared-albums/index.tsx +++ b/src/pages/shared-albums/index.tsx @@ -79,6 +79,9 @@ export default function PublicCollectionGallery() { pathname: PAGES.ROOT, search: currentURL.search, hash: currentURL.hash, + }, + { + shallow: true, } ); } From 8ceaf68259dfb17a8a8d917a2477041438f8ac07 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Thu, 3 Feb 2022 09:58:39 +0530 Subject: [PATCH 6/6] Revert "remove album url label and add spacing after form description" This reverts commit be5e1d96ef83ba53394b31c87d30c57a1253d57c. --- src/components/pages/sharedAlbum/AbuseReportForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/pages/sharedAlbum/AbuseReportForm.tsx b/src/components/pages/sharedAlbum/AbuseReportForm.tsx index f9c8d94ae..262b588a7 100644 --- a/src/components/pages/sharedAlbum/AbuseReportForm.tsx +++ b/src/components/pages/sharedAlbum/AbuseReportForm.tsx @@ -106,7 +106,6 @@ export function AbuseReportForm({ show, close, url }: Iprops) { }}>
{constants.ABUSE_REPORT_DESCRIPTION}
-
initialValues={{ ...defaultInitialValues, @@ -170,6 +169,7 @@ export function AbuseReportForm({ show, close, url }: Iprops) { }): JSX.Element => ( + {constants.ALBUM_URL}