Skip to content

Commit

Permalink
fix: issue with resolving dev environment (#501)
Browse files Browse the repository at this point in the history
* fix: issue with resolving dev environment

* fix: revert accidental commtit

* chore: version bump
  • Loading branch information
cpvalente authored Aug 31, 2023
1 parent a3bbd74 commit 23dcca5
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ontime-ui",
"version": "2.7.0",
"version": "2.7.1",
"private": true,
"dependencies": {
"@chakra-ui/react": "^2.7.0",
Expand Down
3 changes: 2 additions & 1 deletion apps/client/src/common/api/apiConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;

Expand Down
4 changes: 2 additions & 2 deletions apps/client/src/common/utils/socket.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion apps/electron/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ontime",
"version": "2.7.0",
"version": "2.7.1",
"description": "Time keeping for live events",
"keywords": [
"lighdev",
Expand Down

0 comments on commit 23dcca5

Please sign in to comment.