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