client/tags: fix handling malformed tag export

This commit is contained in:
rr- 2016-08-13 13:32:46 +02:00
parent cef3ad8e48
commit 6b77404ecf
2 changed files with 4 additions and 3 deletions

View file

@ -54,10 +54,10 @@ for (let controller of controllers) {
const tags = require('./tags.js'); const tags = require('./tags.js');
const api = require('./api.js'); const api = require('./api.js');
Promise.all([tags.refreshExport(), api.loginFromCookies()]) tags.refreshExport(); // we don't care about errors
.then(() => { api.loginFromCookies().then(() => {
router.start(); router.start();
}).catch(errorMessage => { }, errorMessage => {
if (window.location.href.indexOf('login') !== -1) { if (window.location.href.indexOf('login') !== -1) {
api.forget(); api.forget();
router.start(); router.start();

View file

@ -78,6 +78,7 @@ function refreshExport() {
_tags = new Map(); _tags = new Map();
_categories = new Map(); _categories = new Map();
reject(error); reject(error);
return;
} }
_tags = _tagsToMap( _tags = _tagsToMap(
response.body ? response.body.tags : []); response.body ? response.body.tags : []);