From bbd585af259032346ceb967a4d7b38abc996f7d2 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Wed, 11 Jan 2023 16:01:06 +0530 Subject: [PATCH] added isDevDeployment description --- src/utils/common/apiUtil.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/common/apiUtil.ts b/src/utils/common/apiUtil.ts index ecd3c0bf2..c2999af32 100644 --- a/src/utils/common/apiUtil.ts +++ b/src/utils/common/apiUtil.ts @@ -78,6 +78,12 @@ export const getSentryTunnelURL = () => { return `https://sentry-reporter.ente.io`; }; +/* +It's a dev deployment (and should use the environment override for endpoints ) in three cases: +1. when the URL opened is that of the staging web app, or +2. when the URL opened is that of the staging album app, or +3. if the app is running locally (hence node_env is development) +*/ const isDevDeployment = () => runningInBrowser() && (process.env.NEXT_PUBLIC_ENTE_WEB_ENDPOINT === window.location.origin ||