Infer server port only in dev env

This commit is contained in:
schroda
2025-01-23 12:15:33 +01:00
parent 2cfbaf8148
commit c42e51b6f9
2 changed files with 2 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ export abstract class BaseClient<Client, ClientConfig, Fetcher> {
const { hostname, port, protocol } = window.location;
// if port is 3000 it's probably running from webpack development server
const inferredPort = port === '3000' ? '4567' : port;
const inferredPort = import.meta.env.DEV && port === '3000' ? '4567' : port;
return AppStorage.local.getItemParsed('serverBaseURL', `${protocol}//${hostname}:${inferredPort}`);
}