mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-02 17:50:39 +00:00
Merge pull request #2906 from weaveworks/2858-prevent-zooming-nan-errors
Try to prevent zooming NaN errors
This commit is contained in:
@@ -405,7 +405,8 @@ export function clickTopology(topologyId) {
|
||||
export function cacheZoomState(zoomState) {
|
||||
return {
|
||||
type: ActionTypes.CACHE_ZOOM_STATE,
|
||||
zoomState
|
||||
// Make sure only proper numerical values are cached.
|
||||
zoomState: zoomState.filter(value => !window.isNaN(value)),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user