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));
if (error.code === 'access-denied') {
Promise.all([ Promise.all([
store.dispatch({ type: ACCESS_KEY_ERROR, data: true }), store.dispatch({ type: ACCESS_KEY_ERROR, data: true }),
]).then(() => { ]).then(() => {
replaceState('/login'); replaceState('/login');
cb(); cb();
}); });
} else {
alert(JSON.stringify(error));
}
} }
); );
} }