client/src/components/core/services/networkService.js
// the network to switch to, alongwith the snapshot to load with
the network to switch to, alongwith the snapshot to load with
the network to switch to alongwith the snapshot to load with
function switchNetwork(networkId, snapshot, subdueEvent){
        console.log('Switching to network with id: %O', networkId);
        var network = loadedNetworks[networkId];
        var onAvailable = $q.when(network);
        if(!network) {
            onAvailable = fetchProjectNetwork(networkId);
        }
        return onAvailable
        .then(function(network) {
            console.log('Switching to network: %O', network);
            currentNWId = network.id;
            if(!subdueEvent) {
                $rootScope.$broadcast(BROADCAST_MESSAGES.network.changed, { network : network , snapshot : snapshot });
            }
            return network;
        });
    }
function switchNetwork ( networkId , snapshot , subdueEvent ) { console . log ( 'Switching to network with id: %O' , networkId ) ; var network = loadedNetworks [ networkId ] ; var onAvailable = $q . when ( network ) ; if ( ! network ) { onAvailable = fetchProjectNetwork ( networkId ) ; } return onAvailable . then ( function ( network ) { console . log ( 'Switching to network: %O' , network ) ; currentNWId = network . id ; if ( ! subdueEvent ) { $rootScope . $broadcast ( BROADCAST_MESSAGES . network . changed , { network : network , snapshot : snapshot } ) ; } return network ; } ) ; }
the network to switch to, alongwith the snapshot to load with
the network to switch to alongwith the snapshot to load with
// fetch the network