X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fenv.ts;h=576c6c58e916f9d9274bd40200555a9892a8b19c;hb=2b1af707c3df6126b3e6890106c03c60ad49b1be;hp=ee61f086ff03e47c21fd85afb849e203c65fa817;hpb=f61037f5d89f12818c8100f907a98b74e980112a;p=lemmy-ui.git diff --git a/src/shared/env.ts b/src/shared/env.ts index ee61f08..576c6c5 100644 --- a/src/shared/env.ts +++ b/src/shared/env.ts @@ -34,12 +34,6 @@ function getHost() { return isBrowser() ? getExternalHost() : getInternalHost(); } -function getWsHost() { - return isBrowser() - ? window.lemmyConfig?.wsHost ?? getHost() - : process.env.LEMMY_UI_LEMMY_WS_HOST ?? getExternalHost(); -} - function getBaseLocal(s = "") { return `http${s}://${getHost()}`; } @@ -47,18 +41,20 @@ function getBaseLocal(s = "") { export function getHttpBaseInternal() { return getBaseLocal(); // Don't use secure here } + +export function getHttpBaseExternal() { + return `http${getSecure()}://${getExternalHost()}`; +} + export function getHttpBase() { return getBaseLocal(getSecure()); } -export function getWsUri() { - return `ws${getSecure()}://${getWsHost()}/api/v3/ws`; -} + export function isHttps() { return getSecure() === "s"; } console.log(`httpbase: ${getHttpBase()}`); -console.log(`wsUri: ${getWsUri()}`); console.log(`isHttps: ${isHttps()}`); // This is for html tags, don't include port