From adea60b07eb9b90b4c098a138257fc370acb1a8e Mon Sep 17 00:00:00 2001 From: Filip Barl Date: Mon, 23 Oct 2017 16:28:46 +0200 Subject: [PATCH] Set initial viewport size in global state. --- client/app/scripts/reducers/root.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/app/scripts/reducers/root.js b/client/app/scripts/reducers/root.js index 9bbe144f1..1cfafc5bf 100644 --- a/client/app/scripts/reducers/root.js +++ b/client/app/scripts/reducers/root.js @@ -88,7 +88,8 @@ export const initialState = makeMap({ topologyViewMode: GRAPH_VIEW_MODE, version: '...', versionUpdate: null, - viewport: makeMap(), + // Set some initial numerical values to prevent NaN in case of edgy race conditions. + viewport: makeMap({ width: 0, height: 0 }), websocketClosed: false, zoomCache: makeMap(), serviceImages: makeMap()