diff --git a/apps/client/package.json b/apps/client/package.json index 5989b0685..f92628264 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -1,6 +1,6 @@ { "name": "ontime-ui", - "version": "2.7.0", + "version": "2.7.1", "private": true, "dependencies": { "@chakra-ui/react": "^2.7.0", diff --git a/apps/client/src/common/api/apiConstants.ts b/apps/client/src/common/api/apiConstants.ts index 935a102f1..d94553ac6 100644 --- a/apps/client/src/common/api/apiConstants.ts +++ b/apps/client/src/common/api/apiConstants.ts @@ -12,9 +12,10 @@ export const RUNTIME = ['runtimeStore']; const location = window.location; const socketProtocol = location.protocol === 'https:' ? 'wss' : 'ws'; +export const isProduction = import.meta.env.MODE === 'production'; const STATIC_PORT = 4001; -export const serverPort = import.meta.env.DEV ? STATIC_PORT : location.port; +export const serverPort = isProduction ? location.port : STATIC_PORT; export const serverURL = `${location.protocol}//${location.hostname}:${serverPort}`; export const websocketUrl = `${socketProtocol}://${location.hostname}:${serverPort}/ws`; diff --git a/apps/client/src/common/utils/socket.ts b/apps/client/src/common/utils/socket.ts index 2a54fa16a..17cee8699 100644 --- a/apps/client/src/common/utils/socket.ts +++ b/apps/client/src/common/utils/socket.ts @@ -1,6 +1,6 @@ import { Log, RuntimeStore } from 'ontime-types'; -import { RUNTIME, websocketUrl } from '../api/apiConstants'; +import { isProduction, RUNTIME, websocketUrl } from '../api/apiConstants'; import { ontimeQueryClient } from '../queryClient'; import { socketClientName } from '../stores/connectionName'; import { addLog } from '../stores/logger'; @@ -64,7 +64,7 @@ export const connectSocket = (preferredClientName?: string) => { } case 'ontime': { runtime.setState(payload as RuntimeStore); - if (import.meta.env.DEV) { + if (!isProduction) { ontimeQueryClient.setQueryData(RUNTIME, data.payload); } break; diff --git a/apps/electron/package.json b/apps/electron/package.json index 3e8dd5a1b..9769b2edc 100644 --- a/apps/electron/package.json +++ b/apps/electron/package.json @@ -1,6 +1,6 @@ { "name": "ontime", - "version": "2.7.0", + "version": "2.7.1", "author": "Carlos Valente", "description": "Time keeping for live events", "repository": "https://github.com/cpvalente/ontime", diff --git a/apps/server/package.json b/apps/server/package.json index 73e5ebf37..5b0b6aacd 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -2,7 +2,7 @@ "name": "ontime-server", "type": "module", "main": "src/index.ts", - "version": "2.7.0", + "version": "2.7.1", "exports": "./src/index.js", "dependencies": { "body-parser": "^1.20.0", diff --git a/package.json b/package.json index 625ad1cd9..2fcead234 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ontime", - "version": "2.7.0", + "version": "2.7.1", "description": "Time keeping for live events", "keywords": [ "lighdev",