From 46a338b87435c5c93d2ff75012a15a2351d22321 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Thu, 2 Oct 2025 14:54:47 +0200 Subject: [PATCH] Clean --- common/src/api/utils.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/src/api/utils.ts b/common/src/api/utils.ts index c1143ef7..a750d0be 100644 --- a/common/src/api/utils.ts +++ b/common/src/api/utils.ts @@ -1,4 +1,4 @@ -import {BACKEND_DOMAIN} from 'common/envs/constants' +import {BACKEND_DOMAIN, IS_LOCAL} from 'common/envs/constants' type ErrorCode = | 400 // your input is bad (like zod is mad) @@ -27,12 +27,11 @@ export function pathWithPrefix(path: string) { } export function getWebsocketUrl() { - const protocol = BACKEND_DOMAIN.startsWith('localhost') ? 'ws' : 'wss' - + const protocol = IS_LOCAL ? 'ws' : 'wss' return `${protocol}://${BACKEND_DOMAIN}/ws` } export function getApiUrl(path: string) { - const protocol = BACKEND_DOMAIN.startsWith('localhost') ? 'http' : 'https' + const protocol = IS_LOCAL ? 'http' : 'https' return `${protocol}://${BACKEND_DOMAIN}/${prefix}/${path}` }