From 6b77404ecff3993b3c48c33a6c970b0844b6115c Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 13 Aug 2016 13:32:46 +0200 Subject: [PATCH] client/tags: fix handling malformed tag export --- client/js/main.js | 6 +++--- client/js/tags.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/js/main.js b/client/js/main.js index 919c7ed1..158e787a 100644 --- a/client/js/main.js +++ b/client/js/main.js @@ -54,10 +54,10 @@ for (let controller of controllers) { const tags = require('./tags.js'); const api = require('./api.js'); -Promise.all([tags.refreshExport(), api.loginFromCookies()]) - .then(() => { +tags.refreshExport(); // we don't care about errors +api.loginFromCookies().then(() => { router.start(); - }).catch(errorMessage => { + }, errorMessage => { if (window.location.href.indexOf('login') !== -1) { api.forget(); router.start(); diff --git a/client/js/tags.js b/client/js/tags.js index 9ed3a681..e732400f 100644 --- a/client/js/tags.js +++ b/client/js/tags.js @@ -78,6 +78,7 @@ function refreshExport() { _tags = new Map(); _categories = new Map(); reject(error); + return; } _tags = _tagsToMap( response.body ? response.body.tags : []);