Browse Source

make the isDevDeployment code cleaner

Abhinav 2 years ago
parent
commit
490fad83a6
1 changed files with 11 additions and 6 deletions
  1. 11 6
      src/utils/common/apiUtil.ts

+ 11 - 6
src/utils/common/apiUtil.ts

@@ -76,9 +76,14 @@ It's a dev deployment (and should use the environment override for endpoints ) i
 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 ||
-        process.env.NEXT_PUBLIC_ENTE_ALBUM_ENDPOINT ===
-            window.location.origin ||
-        process.env.NODE_ENV === 'development');
+const isDevDeployment = () => {
+    if (runningInBrowser()) {
+        return (
+            process.env.NEXT_PUBLIC_ENTE_WEB_ENDPOINT ===
+                window.location.origin ||
+            process.env.NEXT_PUBLIC_ENTE_ALBUM_ENDPOINT ===
+                window.location.origin ||
+            process.env.NODE_ENV === 'development'
+        );
+    }
+};