Added changeInstance action; exported actions to public API

This commit is contained in:
jpellizzari
2017-02-09 13:44:30 -08:00
parent d91fc5c310
commit 8b1ca73179
3 changed files with 17 additions and 4 deletions
+4 -3
View File
@@ -166,11 +166,12 @@ export function getTopologies(options, dispatch) {
});
}
export function getNodesDelta(topologyUrl, options, dispatch) {
export function getNodesDelta(topologyUrl, options, dispatch, forceReload) {
const optionsQuery = buildOptionsQuery(options);
// only recreate websocket if url changed or if forced (weave cloud instance reload);
const isNewUrl = topologyUrl && (topologyUrl !== currentUrl || currentOptions !== optionsQuery);
// only recreate websocket if url changed
if (topologyUrl && (topologyUrl !== currentUrl || currentOptions !== optionsQuery)) {
if (forceReload || isNewUrl) {
createWebsocket(topologyUrl, optionsQuery, dispatch);
currentUrl = topologyUrl;
currentOptions = optionsQuery;