Profile editing: Fix bug with reordering (#38147)

This commit is contained in:
Echo
2026-03-11 13:09:54 +01:00
committed by GitHub
parent da4b717211
commit f971670c62
2 changed files with 8 additions and 5 deletions

View File

@@ -212,11 +212,9 @@ export const ReorderFieldsModal: FC<DialogModalProps> = ({ onClose }) => {
return;
}
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]);
const emojis = useAppSelector((state) => state.custom_emojis);

View File

@@ -221,7 +221,12 @@ export const patchProfile = createDataLoadingThunk(
`${profileEditSlice.name}/patchProfile`,
(params: Partial<ApiProfileUpdateParams>) => apiPatchProfile(params),
transformProfile,
{ useLoadingBar: false },
{
useLoadingBar: false,
condition(_, { getState }) {
return !getState().profileEdit.isPending;
},
},
);
export const selectFieldById = createAppSelector(