Skip to content

armgit / ente

Public Imported from GitHub
0

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

Rename public access wrapper and drop symlink upload result

Anand Baburajane88de2cff16d
diff --git a/web/apps/albums/src/gallery/services/upload/index.ts b/web/apps/albums/src/gallery/services/upload/index.ts
index b4391198ec..81794912fa 100644
--- a/web/apps/albums/src/gallery/services/upload/index.ts
+++ b/web/apps/albums/src/gallery/services/upload/index.ts
@@ -66,7 +66,6 @@ export type UploadResult =
| { type: "blocked" }
| { type: "failed" }
| { type: "alreadyUploaded"; file: EnteFile }
- | { type: "addedSymlink"; file: EnteFile }
| { type: "uploadedWithStaticThumbnail"; file: EnteFile }
| { type: "uploaded"; file: EnteFile };
diff --git a/web/apps/albums/src/public-album/components/PasswordUnlockScreen.tsx b/web/apps/albums/src/public-album/components/PasswordUnlockScreen.tsx
index f880ac2d8e..354d519e09 100644
--- a/web/apps/albums/src/public-album/components/PasswordUnlockScreen.tsx
+++ b/web/apps/albums/src/public-album/components/PasswordUnlockScreen.tsx
@@ -5,9 +5,9 @@ import {
} from "ente-base/components/SingleInputForm";
import { t } from "i18next";
import {
- AccountsPageContents,
- AccountsPageTitle,
-} from "@/public-album/components/AccountsPage";
+ PublicAccessPageContents,
+ PublicAccessPageTitle,
+} from "@/public-album/components/PublicAccessPage";
export interface PasswordUnlockScreenProps {
onSubmit: SingleInputFormProps["onSubmit"];
@@ -16,8 +16,8 @@ export interface PasswordUnlockScreenProps {
export const PasswordUnlockScreen: React.FC<PasswordUnlockScreenProps> = ({
onSubmit,
}) => (
- <AccountsPageContents>
- <AccountsPageTitle>{t("password")}</AccountsPageTitle>
+ <PublicAccessPageContents>
+ <PublicAccessPageTitle>{t("password")}</PublicAccessPageTitle>
<Stack>
<Typography variant="small" sx={{ color: "text.muted", mb: 2 }}>
{t("link_password_description")}
@@ -30,5 +30,5 @@ export const PasswordUnlockScreen: React.FC<PasswordUnlockScreenProps> = ({
onSubmit={onSubmit}
/>
</Stack>
- </AccountsPageContents>
+ </PublicAccessPageContents>
);
diff --git a/web/apps/albums/src/public-album/components/AccountsPage.tsx b/web/apps/albums/src/public-album/components/PublicAccessPage.tsx
similarity index 82%
rename from web/apps/albums/src/public-album/components/AccountsPage.tsx
rename to web/apps/albums/src/public-album/components/PublicAccessPage.tsx
index 078da3ec53..0fc81d5012 100644
--- a/web/apps/albums/src/public-album/components/AccountsPage.tsx
+++ b/web/apps/albums/src/public-album/components/PublicAccessPage.tsx
@@ -3,7 +3,7 @@ import { CenteredFill } from "ente-base/components/containers";
import { EnteLogo } from "ente-base/components/EnteLogo";
import { NavbarBase } from "ente-base/components/Navbar";
-export const AccountsPageContents: React.FC<React.PropsWithChildren> = ({
+export const PublicAccessPageContents: React.FC<React.PropsWithChildren> = ({
children,
}) => (
<Stack
@@ -28,15 +28,15 @@ export const AccountsPageContents: React.FC<React.PropsWithChildren> = ({
(theme) =>
theme.applyStyles("dark", {
bgcolor: "background.default",
- }),
+ }),
]}
>
- <AccountsPagePaper>{children}</AccountsPagePaper>
+ <PublicAccessPagePaper>{children}</PublicAccessPagePaper>
</CenteredFill>
</Stack>
);
-const AccountsPagePaper = styled(Paper)(({ theme }) => ({
+const PublicAccessPagePaper = styled(Paper)(({ theme }) => ({
marginBlock: theme.spacing(2),
padding: theme.spacing(5, 3),
[theme.breakpoints.up("sm")]: { padding: theme.spacing(5) },
@@ -49,7 +49,7 @@ const AccountsPagePaper = styled(Paper)(({ theme }) => ({
borderRadius: "20px",
}));
-export const AccountsPageTitle: React.FC<React.PropsWithChildren> = ({
+export const PublicAccessPageTitle: React.FC<React.PropsWithChildren> = ({
children,
}) => (
<Typography variant="h3" sx={{ flex: 1 }}>
diff --git a/web/apps/albums/src/public-album/services/upload-manager.ts b/web/apps/albums/src/public-album/services/upload-manager.ts
index dd1a9bdcd6..b66a27ce5e 100644
--- a/web/apps/albums/src/public-album/services/upload-manager.ts
+++ b/web/apps/albums/src/public-album/services/upload-manager.ts
@@ -52,10 +52,9 @@ export interface InProgressUpload {
/**
* A variant of {@link UploadResult}'s {@link type} values used when segregating
- * finished uploads in the UI. "addedSymlink" is treated as "uploaded",
- * everything else remains as it were.
+ * finished uploads in the UI.
*/
-export type FinishedUploadType = Exclude<UploadResult["type"], "addedSymlink">;
+export type FinishedUploadType = UploadResult["type"];
export type InProgressUploads = Map<FileID, PercentageUploaded>;
@@ -482,14 +481,13 @@ class UploadManager {
this.failedItems.push(uploadableItem);
break;
- case "addedSymlink":
case "uploaded":
case "uploadedWithStaticThumbnail":
this.updateExistingFiles(uploadResult.file);
break;
}
- return type == "addedSymlink" ? "uploaded" : type;
+ return type;
}
public cancelRunningUpload() {