diff options
| author | jc0b <j@jc0b.computer> | 2020-07-21 21:22:44 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:14 +0200 |
| commit | 67b6ec800df8e023efadb60ae5f7919030b19789 (patch) | |
| tree | 9aa496408a4097857b6a032b84dd0a396321e1d3 /frontend/src | |
| parent | 5b4ab37ac7be2b2c34e2fad928b0cd7f3a837263 (diff) | |
| parent | 04686bf5cef4aea51fd613a158aa8b155763d0e7 (diff) | |
Merge branch 'master' onto local working copy
Preserve working copy while updating
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, |
