Skip to content

armgit / ente

Public Imported from GitHub
0

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

Skip on our own prod

Manav Rathi57a674fd2693
diff --git a/web/apps/photos/src/pages/index.tsx b/web/apps/photos/src/pages/index.tsx
index e359e572de..5c50e1de48 100644
--- a/web/apps/photos/src/pages/index.tsx
+++ b/web/apps/photos/src/pages/index.tsx
@@ -162,6 +162,9 @@ const TappableContainer: React.FC<React.PropsWithChildren> = ({ children }) => {
const handleClick: React.MouseEventHandler = (event) => {
console.log("click", tapCount, event, event.target);
+ // Don't allow this when runinng on (e.g.) web.ente.io.
+ if (!shouldAllowChangingAPIOrigin()) return;
+
// Ignore clicks on buttons when counting up towards 7.
if (event.target instanceof HTMLButtonElement) return;
@@ -202,6 +205,15 @@ const TappableContainer_ = styled("div")`
}
`;
+/**
+ * Disable the ability to set the custom server when we're running on our own
+ * production deployment.
+ */
+const shouldAllowChangingAPIOrigin = () => {
+ const hostname = new URL(window.location.origin).hostname;
+ return !(hostname.endsWith(".ente.io") || hostname.endsWith(".ente.sh"));
+};
+
const SlideContainer = styled("div")`
flex: 1;
display: flex;