mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 10:11:03 +00:00
Merge pull request #1893 from weaveworks/1880-fixes-ui-hang-on-absent-topo
Fixes UI hanging if currentTopology no longer exists for some reason
This commit is contained in:
@@ -606,7 +606,8 @@ export function rootReducer(state = initialState, action) {
|
||||
state = state.set('errorUrl', null);
|
||||
state = state.update('topologyUrlsById', topologyUrlsById => topologyUrlsById.clear());
|
||||
state = processTopologies(state, action.topologies);
|
||||
if (!state.get('currentTopologyId')) {
|
||||
const currentTopologyId = state.get('currentTopologyId');
|
||||
if (!currentTopologyId || !findTopologyById(state.get('topologies'), currentTopologyId)) {
|
||||
state = state.set('currentTopologyId', getDefaultTopology(state.get('topologies')));
|
||||
log(`Set currentTopologyId to ${state.get('currentTopologyId')}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user