console: handle non access key errors (#356)

[skip ci]
This commit is contained in:
Praveen Durairaj 2018-09-05 18:38:19 +05:30 committed by Shahidh K Muhammed
parent 258885ad4d
commit a49188a606

View File

@ -194,12 +194,16 @@ const dataRouter = (connect, store, composeOnEnterHooks) => {
}, },
error => { error => {
console.error(JSON.stringify(error)); console.error(JSON.stringify(error));
Promise.all([ if (error.code === 'access-denied') {
store.dispatch({ type: ACCESS_KEY_ERROR, data: true }), Promise.all([
]).then(() => { store.dispatch({ type: ACCESS_KEY_ERROR, data: true }),
replaceState('/login'); ]).then(() => {
cb(); replaceState('/login');
}); cb();
});
} else {
alert(JSON.stringify(error));
}
} }
); );
} }