Profile editing: Fix bug with reordering (#38147)
This commit is contained in:
parent
da4b717211
commit
f971670c62
@ -212,11 +212,9 @@ export const ReorderFieldsModal: FC<DialogModalProps> = ({ onClose }) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
newFields.push({ name: field.name, value: field.value });
|
newFields.push({ name: field.name, value: field.value });
|
||||||
|
|
||||||
void dispatch(patchProfile({ fields_attributes: newFields })).then(
|
|
||||||
onClose,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dispatch(patchProfile({ fields_attributes: newFields })).then(onClose);
|
||||||
}, [dispatch, fieldKeys, fields, onClose]);
|
}, [dispatch, fieldKeys, fields, onClose]);
|
||||||
|
|
||||||
const emojis = useAppSelector((state) => state.custom_emojis);
|
const emojis = useAppSelector((state) => state.custom_emojis);
|
||||||
|
|||||||
@ -221,7 +221,12 @@ export const patchProfile = createDataLoadingThunk(
|
|||||||
`${profileEditSlice.name}/patchProfile`,
|
`${profileEditSlice.name}/patchProfile`,
|
||||||
(params: Partial<ApiProfileUpdateParams>) => apiPatchProfile(params),
|
(params: Partial<ApiProfileUpdateParams>) => apiPatchProfile(params),
|
||||||
transformProfile,
|
transformProfile,
|
||||||
{ useLoadingBar: false },
|
{
|
||||||
|
useLoadingBar: false,
|
||||||
|
condition(_, { getState }) {
|
||||||
|
return !getState().profileEdit.isPending;
|
||||||
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
export const selectFieldById = createAppSelector(
|
export const selectFieldById = createAppSelector(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user