Skip to content

armgit / ente

Public Imported from GitHub
0

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

Use embedURL setting for embed HTML and remove feature flag

Manav Rathif5ee880a3508
diff --git a/web/apps/photos/src/components/Collections/CollectionShare.tsx b/web/apps/photos/src/components/Collections/CollectionShare.tsx
index 442f837133..d74c00c82b 100644
--- a/web/apps/photos/src/components/Collections/CollectionShare.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionShare.tsx
@@ -1371,11 +1371,17 @@ const ManagePublicShareOptions: React.FC<ManagePublicShareOptionsProps> = ({
onRemotePull,
}) => {
const [errorMessage, setErrorMessage] = useState("");
+ const { embedURL: embedBaseURL } = useSettingsSnapshot();
const [copied, handleCopyLink] = useClipboardCopy(resolvedURL);
// For embeddable HTML copy
- const embedURL = resolvedURL?.replace("albums.ente.io", "embed.ente.io");
+ const embedURL = resolvedURL
+ ? resolvedURL.replace(
+ new URL(resolvedURL).origin,
+ embedBaseURL || "https://embed.ente.io",
+ )
+ : undefined;
const iframeHTML = embedURL
? `<iframe src="${embedURL}" width="800" height="600" frameborder="0" allowfullscreen></iframe>`
: "";
@@ -1471,25 +1477,18 @@ const ManagePublicShareOptions: React.FC<ManagePublicShareOptionsProps> = ({
onClick={handleCopyLink}
label={t("copy_link")}
/>
- {process.env.NEXT_PUBLIC_EMBED_FEATURE_ENABLED ===
- "true" && (
- <>
- <RowButtonDivider />
- <RowButton
- startIcon={
- embedCopied ? (
- <DoneIcon
- sx={{ color: "accent.main" }}
- />
- ) : (
- <CodeIcon />
- )
- }
- onClick={handleCopyEmbedLink}
- label="Copy embed HTML"
- />
- </>
- )}
+ <RowButtonDivider />
+ <RowButton
+ startIcon={
+ embedCopied ? (
+ <DoneIcon sx={{ color: "accent.main" }} />
+ ) : (
+ <CodeIcon />
+ )
+ }
+ onClick={handleCopyEmbedLink}
+ label={t("copy_embed_html")}
+ />
</RowButtonGroup>
<RowButtonGroup>
<RowButton
diff --git a/web/packages/base/locales/en-US/translation.json b/web/packages/base/locales/en-US/translation.json
index 0bf2fca972..a9cc8062cd 100644
--- a/web/packages/base/locales/en-US/translation.json
+++ b/web/packages/base/locales/en-US/translation.json
@@ -431,6 +431,7 @@
"year": "After a year"
},
"copy_link": "Copy link",
+ "copy_embed_html": "Copy embed HTML",
"done": "Done",
"share_link_section_title": "Or share a link",
"remove_link": "Remove link",