Browse Source

make the isDevDeployment code cleaner

Abhinav 2 năm trước cách đây
mục cha
commit
490fad83a6
1 tập tin đã thay đổi với 11 bổ sung6 xóa
  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
 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)
 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'
+        );
+    }
+};