From 0fbdddbda691b5beec98bef59c9caebbaa1cc2d9 Mon Sep 17 00:00:00 2001 From: Sigve Kvalsvik Date: Sat, 14 Oct 2017 11:04:29 +0200 Subject: [PATCH] Fix ChainStore failing to notify after reset and latency check counter --- app/routerTransition.js | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/routerTransition.js b/app/routerTransition.js index df5f639abb..0a18987934 100644 --- a/app/routerTransition.js +++ b/app/routerTransition.js @@ -12,7 +12,7 @@ import AccountStore from "stores/AccountStore"; import ls from "common/localStorage"; const STORAGE_KEY = "__graphene__"; const ss = new ls(STORAGE_KEY); -const latencyChecks = ss.get("latencyChecks", 1); +let latencyChecks; import counterpart from "counterpart"; // Actions @@ -54,9 +54,10 @@ const filterAndSortURLs = (count, latencies) => { let _connectInProgress = false; -let _connectionCheckPromise = null +let _connectionCheckPromise = null; const willTransitionTo = (nextState, replaceState, callback, appInit=true) => { //appInit is true when called via router onEnter, and false when node is manually selected in access settings const apiLatencies = SettingsStore.getState().apiLatencies; + latencyChecks = ss.get("latencyChecks", 1); let apiLatenciesCount = Object.keys(apiLatencies).length; let connectionStart; @@ -92,7 +93,6 @@ const willTransitionTo = (nextState, replaceState, callback, appInit=true) => { if (!autoSelection) SettingsActions.changeSetting({setting: "apiServer", value: currentUrl}); if (!(currentUrl in apiLatencies)) { apiLatencies[currentUrl] = new Date().getTime() - connectionStart; - console.log("set latency to:", apiLatencies[currentUrl]); } } const currentChain = Apis.instance().chain_id; @@ -154,7 +154,7 @@ const willTransitionTo = (nextState, replaceState, callback, appInit=true) => { }; var onResetError = (err) => { - console.log("err:", err); + console.log("onResetError:", err); oldChain = "old"; connect = true; notify.addNotification({ diff --git a/package.json b/package.json index 5a24721432..96857f2f34 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "alt-container": "^1.0.0", "alt-react": "0.0.1", "bignumber.js": "^4.0.0", - "bitsharesjs": "^1.3.3", + "bitsharesjs": "^1.3.4", "classnames": "^2.2.1", "cookies-js": "^1.2.1", "counterpart": "^0.17.1",