Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

take users directly to album after joining public album

Anand Baburajan9a3286dc8629
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 41ec0a926b..36d868d1e2 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -3,20 +3,9 @@
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable @typescript-eslint/no-floating-promises */
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
-import ArrowForwardIcon from "@mui/icons-material/ArrowForward";
-import CloseIcon from "@mui/icons-material/Close";
import FileUploadOutlinedIcon from "@mui/icons-material/FileUploadOutlined";
import MenuIcon from "@mui/icons-material/Menu";
-import {
- Box,
- DialogTitle,
- IconButton,
- Link,
- Paper,
- Snackbar,
- Stack,
- Typography,
-} from "@mui/material";
+import { IconButton, Link, Stack, Typography } from "@mui/material";
import type { AddToAlbumPhase } from "components/AlbumAddedNotification";
import { AlbumAddedNotification } from "components/AlbumAddedNotification";
import { AuthenticateUser } from "components/AuthenticateUser";
@@ -41,7 +30,6 @@ import { SingleInputDialog } from "ente-base/components/SingleInputDialog";
import { CenteredRow } from "ente-base/components/containers";
import { TranslucentLoadingOverlay } from "ente-base/components/loaders";
import type { ButtonishProps } from "ente-base/components/mui";
-import { FilledIconButton } from "ente-base/components/mui";
import { FocusVisibleButton } from "ente-base/components/mui/FocusVisibleButton";
import { errorDialogAttributes } from "ente-base/components/utils/dialog";
import { useIsSmallWidth } from "ente-base/components/utils/hooks";
@@ -189,10 +177,6 @@ const Page: React.FC = () => {
[],
);
const [isFileViewerOpen, setIsFileViewerOpen] = useState(false);
- const [albumJoinedToast, setAlbumJoinedToast] = useState<{
- open: boolean;
- albumId?: number;
- }>({ open: false });
// Pending navigation from feed item click
const [pendingFileNavigation, setPendingFileNavigation] = useState<{
@@ -451,9 +435,12 @@ const Page: React.FC = () => {
// Fetch data from remote (this will include the newly joined album if any)
await remotePull();
- // Now that data is loaded, show the toast if we joined an album
+ // Navigate directly to the joined album
if (joinedAlbumId) {
- setAlbumJoinedToast({ open: true, albumId: joinedAlbumId });
+ dispatch({
+ type: "showCollectionSummary",
+ collectionSummaryID: joinedAlbumId,
+ });
}
// Clear the first load message if needed.
@@ -1522,51 +1509,6 @@ const Page: React.FC = () => {
}}
onSubmit={handleAlbumNameSubmit}
/>
- <Snackbar
- open={albumJoinedToast.open}
- anchorOrigin={{ horizontal: "right", vertical: "bottom" }}
- >
- <Paper sx={{ width: "min(360px, 100svw)" }}>
- <DialogTitle>
- <Stack
- direction="row"
- sx={{
- justifyContent: "space-between",
- alignItems: "center",
- }}
- >
- <Box>
- <Typography variant="h3">
- {t("joined_album")}
- </Typography>
- </Box>
- <Stack direction="row" sx={{ gap: 1 }}>
- <FilledIconButton
- onClick={() => {
- if (albumJoinedToast.albumId) {
- dispatch({
- type: "showCollectionSummary",
- collectionSummaryID:
- albumJoinedToast.albumId,
- });
- }
- setAlbumJoinedToast({ open: false });
- }}
- >
- <ArrowForwardIcon />
- </FilledIconButton>
- <FilledIconButton
- onClick={() =>
- setAlbumJoinedToast({ open: false })
- }
- >
- <CloseIcon />
- </FilledIconButton>
- </Stack>
- </Stack>
- </DialogTitle>
- </Paper>
- </Snackbar>
<AlbumAddedNotification
open={addToAlbumProgress.open}
onClose={() =>