Commit 5b7b49cc authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Clement Ho

Remove nested Promise from groups select

parent def26df0
......@@ -4,9 +4,7 @@ import Api from './api';
import { normalizeHeaders } from './lib/utils/common_utils';
import { __ } from '~/locale';
export default function groupsSelect() {
import(/* webpackChunkName: 'select2' */ 'select2/select2')
.then(() => {
const groupsSelect = () => {
// Needs to be accessible in rspec
window.GROUP_SELECT_PER_PAGE = 20;
$('.ajax-groups-select').each(function setAjaxGroupsSelect2() {
......@@ -94,6 +92,9 @@ export default function groupsSelect() {
dropdown.style.height = `${Math.floor(dropdown.scrollHeight)}px`;
});
});
})
};
export default () =>
import(/* webpackChunkName: 'select2' */ 'select2/select2')
.then(groupsSelect)
.catch(() => {});
}
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