mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Handle loading message for empty topos correctly.
It was showing infinite loading...
This commit is contained in:
@@ -468,6 +468,8 @@ export function receiveNodeDetails(details) {
|
||||
|
||||
export function receiveNodesDelta(delta) {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({ type: ActionTypes.SET_RECEIVED_NODES_DELTA });
|
||||
|
||||
if (delta.add || delta.update || delta.remove) {
|
||||
const state = getState();
|
||||
if (state.get('updatePausedAt') !== null) {
|
||||
|
||||
@@ -54,6 +54,7 @@ const ACTION_TYPES = [
|
||||
'PIN_NETWORK',
|
||||
'UNPIN_NETWORK',
|
||||
'SHOW_NETWORKS',
|
||||
'SET_RECEIVED_NODES_DELTA',
|
||||
];
|
||||
|
||||
export default _.zipObject(ACTION_TYPES, ACTION_TYPES);
|
||||
|
||||
@@ -10,7 +10,6 @@ import { getNetworkNodes, getAvailableNetworks } from '../utils/network-view-uti
|
||||
import { findTopologyById, getAdjacentNodes, setTopologyUrlsById,
|
||||
updateTopologyIds, filterHiddenTopologies } from '../utils/topology-utils';
|
||||
|
||||
const log = debug('scope:app-store');
|
||||
const error = debug('scope:error');
|
||||
|
||||
// Helpers
|
||||
@@ -481,18 +480,11 @@ export function rootReducer(state = initialState, action) {
|
||||
return state;
|
||||
}
|
||||
|
||||
case ActionTypes.SET_RECEIVED_NODES_DELTA: {
|
||||
return state.set('nodesLoaded', true);
|
||||
}
|
||||
|
||||
case ActionTypes.RECEIVE_NODES_DELTA: {
|
||||
const emptyMessage = !action.delta.add && !action.delta.remove
|
||||
&& !action.delta.update;
|
||||
state = state.set('nodesLoaded', true);
|
||||
|
||||
if (!emptyMessage) {
|
||||
log('RECEIVE_NODES_DELTA',
|
||||
'remove', _.size(action.delta.remove),
|
||||
'update', _.size(action.delta.update),
|
||||
'add', _.size(action.delta.add));
|
||||
}
|
||||
|
||||
state = state.set('errorUrl', null);
|
||||
|
||||
// nodes that no longer exist
|
||||
|
||||
Reference in New Issue
Block a user