]> Untitled Git - lemmy-ui.git/blobdiff - src/shared/env.ts
Running newer prettier.
[lemmy-ui.git] / src / shared / env.ts
index 9fd5039a4a6a6a13584014a2c63cdd1765916713..c99c0001f9c061ad3a350fecdbb2c5c68666fec8 100644 (file)
@@ -1,6 +1,6 @@
-import { isBrowser } from './utils';
+import { isBrowser } from "./utils";
 
-const testHost = 'localhost:8536';
+const testHost = "localhost:8536";
 
 let internalHost =
   (!isBrowser() && process.env.LEMMY_INTERNAL_HOST) || testHost; // used for local dev
@@ -12,25 +12,25 @@ let secure: string;
 if (isBrowser()) {
   // browser
   const lemmyConfig =
-    typeof window.lemmyConfig !== 'undefined' ? window.lemmyConfig : {};
+    typeof window.lemmyConfig !== "undefined" ? window.lemmyConfig : {};
 
   externalHost = `${window.location.hostname}${
-    ['1234', '1235'].includes(window.location.port)
-      ? ':8536'
-      : window.location.port == ''
-      ? ''
+    ["1234", "1235"].includes(window.location.port)
+      ? ":8536"
+      : window.location.port == ""
+      ? ""
       : `:${window.location.port}`
   }`;
 
   host = externalHost;
   wsHost = lemmyConfig.wsHost || host;
-  secure = window.location.protocol == 'https:' ? 's' : '';
+  secure = window.location.protocol == "https:" ? "s" : "";
 } else {
   // server-side
   externalHost = process.env.LEMMY_EXTERNAL_HOST || testHost;
   host = internalHost;
   wsHost = process.env.LEMMY_WS_HOST || host;
-  secure = process.env.LEMMY_HTTPS == 'true' ? 's' : '';
+  secure = process.env.LEMMY_HTTPS == "true" ? "s" : "";
 }
 
 const httpBase = `http://${host}`; // Don't use secure here
@@ -42,7 +42,7 @@ console.log(`httpbase: ${httpBase}`);
 console.log(`wsUri: ${wsUri}`);
 
 // This is for html tags, don't include port
-const httpExternalUri = `http${secure}://${externalHost.split(':')[0]}`;
+const httpExternalUri = `http${secure}://${externalHost.split(":")[0]}`;
 export function httpExternalPath(path: string) {
   return `${httpExternalUri}${path}`;
 }