Commit 79005021 authored by Clement Ho's avatar Clement Ho

Merge branch 'winh-eslint-promise/no-nesting-user_popovers.js' into 'master'

Remove nested Promise from user popover

See merge request gitlab-org/gitlab!17688
parents 61df1924 07c91cda
......@@ -63,7 +63,7 @@ const handleUserPopoverMouseOver = event => {
UsersCache.retrieveById(userId)
.then(userData => {
if (!userData) {
return;
return undefined;
}
Object.assign(user, {
......@@ -76,19 +76,16 @@ const handleUserPopoverMouseOver = event => {
loaded: true,
});
UsersCache.retrieveStatusById(userId)
.then(status => {
if (!status) {
return;
}
return UsersCache.retrieveStatusById(userId);
})
.then(status => {
if (!status) {
return;
}
Object.assign(user, {
status,
});
})
.catch(() => {
throw new Error(`User status for "${userId}" could not be retrieved!`);
});
Object.assign(user, {
status,
});
})
.catch(() => {
renderedPopover.$destroy();
......
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