Commit a6b7ef3c authored by Eric Rosenbaum's avatar Eric Rosenbaum

reload managers before closing modal

parent 65eddfe4
......@@ -45,7 +45,7 @@ const normalizeError = (err, body, res) => {
return null;
};
const loadManagers = (reloadAll = false) => ((dispatch, getState) => {
const loadManagers = (reloadAll = false) => ((dispatch, getState) => new Promise(resolve => {
const state = getState();
const studioId = selectStudioId(state);
const managerCount = reloadAll ? 0 : managers.selector(state).items.length;
......@@ -58,8 +58,9 @@ const loadManagers = (reloadAll = false) => ((dispatch, getState) => {
if (error) return dispatch(managers.actions.error(error));
if (reloadAll) dispatch(managers.actions.clear());
dispatch(managers.actions.append(body, body.length === PER_PAGE_LIMIT));
return resolve();
});
});
}));
const loadCurators = () => ((dispatch, getState) => {
const state = getState();
......
......@@ -47,9 +47,9 @@ const TransferHostConfirmation = ({
const handleSubmit = () => {
setSubmitting(true);
handleTransferHost(passwordInputValue, newHostUsername, selectedId)
.then(() => handleLoadManagers(true)) // reload the list of managers, to get them in the correct order
.then(() => {
handleClose();
handleLoadManagers(true); // reload the list of managers, to get them in the correct order
successAlert({
id: 'studio.alertTransfer',
values: {name: newHostUsername}
......
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