fix: link generation should add prefix

This commit is contained in:
Carlos Valente
2025-03-18 21:47:51 +01:00
committed by Carlos Valente
parent b2eb140ee2
commit 0a6542df76
3 changed files with 66 additions and 6 deletions
+2 -1
View File
@@ -16,13 +16,14 @@ export const isDocker = env === 'docker';
export const isProduction = isDocker || (env === 'production' && !isTest);
export const isOntimeCloud = Boolean(process.env.IS_CLOUD);
export const password = process.env.SESSION_PASSWORD;
export const routerPrefix = process.env.ROUTER_PREFIX;
/**
* Updates the router prefix in the index.html file
* This is only needed in the cloud environment where the client is not at the root segment
* ie: https://cloud.getontime.com/client-hash/timer
*/
export function updateRouterPrefix(prefix: string | undefined = process.env.ROUTER_PREFIX): string {
export function updateRouterPrefix(prefix: string | undefined = routerPrefix): string {
if (!prefix) {
return '';
}