Commit 2db115c6 authored by Tim Zallmann's avatar Tim Zallmann

Merge branch 'winh-eslint-promise/no-nesting-board_blank_state.vue' into 'master'

Remove nested Promise from board blank state

See merge request gitlab-org/gitlab!17684
parents 984e63ef a5eea410
...@@ -29,25 +29,25 @@ export default { ...@@ -29,25 +29,25 @@ export default {
}); });
}); });
// Save the labels const loadListIssues = listObj => {
boardsStore
.generateDefaultLists()
.then(res => res.data)
.then(data => {
data.forEach(listObj => {
const list = boardsStore.findList('title', listObj.title); const list = boardsStore.findList('title', listObj.title);
if (!list) { if (!list) {
return; return null;
} }
list.id = listObj.id; list.id = listObj.id;
list.label.id = listObj.label.id; list.label.id = listObj.label.id;
list.getIssues().catch(() => { return list.getIssues().catch(() => {
// TODO: handle request error // TODO: handle request error
}); });
}); };
})
// Save the labels
boardsStore
.generateDefaultLists()
.then(res => res.data)
.then(data => Promise.all(data.map(loadListIssues)))
.catch(() => { .catch(() => {
boardsStore.removeList(undefined, 'label'); boardsStore.removeList(undefined, 'label');
Cookies.remove('issue_board_welcome_hidden', { Cookies.remove('issue_board_welcome_hidden', {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment