From 6773724c19039c0ca9381a11473034cc548fbde5 Mon Sep 17 00:00:00 2001 From: Sigve Kvalsvik Date: Wed, 11 Oct 2017 11:08:13 +0200 Subject: [PATCH] #531: Catch some app init errors and redirect, update indexeddbshim --- app/routerTransition.js | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/routerTransition.js b/app/routerTransition.js index 2cf185e2a7..9cc2a9fe18 100644 --- a/app/routerTransition.js +++ b/app/routerTransition.js @@ -127,6 +127,10 @@ const willTransitionTo = (nextState, replaceState, callback, appInit=true) => { SettingsActions.changeSetting({setting: "activeNode", value: connectionManager.url}); callback(); }); + }).catch(err => { + console.error(err); + replaceState("/init-error"); + callback(); }); }; @@ -192,7 +196,11 @@ const willTransitionTo = (nextState, replaceState, callback, appInit=true) => { /* Only try initialize the API with connect = true on the first onEnter */ connect = false; - })); + })).catch(err => { + console.error(err); + replaceState("/init-error"); + callback(); + }); // Every 15 connections we check the latencies of the full list of nodes diff --git a/package.json b/package.json index 7819bf059c..604eac101a 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "fractional": "^1.0.0", "highcharts": "4.2.6", "immutable": "^3.8.1", - "indexeddbshim": "^2.0.4", + "indexeddbshim": "^2.2.1", "intl": "^1.1.0", "jdenticon": "git+https://github.com/cryptonomex/jdenticon.git", "js-sha256": "^0.2.3",