diff options
Diffstat (limited to 'frontend/src')
| -rw-r--r-- | frontend/src/api/socket.js | 8 | ||||
| -rw-r--r-- | frontend/src/shapes/index.js | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/frontend/src/api/socket.js b/frontend/src/api/socket.js index 93ce8fa8..759c119e 100644 --- a/frontend/src/api/socket.js +++ b/frontend/src/api/socket.js @@ -6,11 +6,9 @@ let requestIdCounter = 0 const callbacks = {} export function setupSocketConnection(onConnect) { - let port = window.location.port - if (process.env.NODE_ENV !== 'production') { - port = 8081 - } - socket = io.connect(window.location.protocol + '//' + window.location.hostname + ':' + port) + const apiUrl = process.env.REACT_APP_API_URL || window.location.hostname + ':' + window.location.port; + + socket = io.connect(window.location.protocol + '//' + apiUrl); socket.on('connect', onConnect) socket.on('response', onSocketResponse) } diff --git a/frontend/src/shapes/index.js b/frontend/src/shapes/index.js index 32914f25..8296055a 100644 --- a/frontend/src/shapes/index.js +++ b/frontend/src/shapes/index.js @@ -111,7 +111,9 @@ Shapes.Scenario = PropTypes.shape({ _id: PropTypes.string.isRequired, portfolioId: PropTypes.string.isRequired, name: PropTypes.string.isRequired, - simulationState: PropTypes.string.isRequired, + simulation: PropTypes.shape({ + state: PropTypes.string.isRequired, + }).isRequired, trace: PropTypes.shape({ traceId: PropTypes.string.isRequired, trace: Shapes.Trace, |
