浏览代码

make the isDevDeployment code cleaner

Abhinav 2 年之前
父节点
当前提交
490fad83a6
共有 1 个文件被更改,包括 11 次插入6 次删除
  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'
+        );
+    }
+};