Merge pull request #348 from ente-io/master

release public url changes
This commit is contained in:
Abhinav Kumar 2022-02-03 11:18:21 +05:30 committed by GitHub
commit 057433749b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 19 deletions

View file

@ -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();
};

View file

@ -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 = () => (
<Container>
@ -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 <Loader />;
}
if (!publicFiles?.length && !loading) {
if (!publicFiles && !loading) {
return <Container>{constants.NOT_FOUND}</Container>;
}

View file

@ -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',