summaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
authorjc0b <j@jc0b.computer>2020-07-21 21:22:44 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:48:14 +0200
commit67b6ec800df8e023efadb60ae5f7919030b19789 (patch)
tree9aa496408a4097857b6a032b84dd0a396321e1d3 /frontend/src
parent5b4ab37ac7be2b2c34e2fad928b0cd7f3a837263 (diff)
parent04686bf5cef4aea51fd613a158aa8b155763d0e7 (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.js8
-rw-r--r--frontend/src/shapes/index.js4
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,