mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 08:31:23 -05:00
reload managers before closing modal
This commit is contained in:
parent
65eddfe420
commit
a6b7ef3c4b
2 changed files with 4 additions and 3 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue