diff --git a/app/javascript/flavours/glitch/features/account_edit/modals/fields_reorder_modal.tsx b/app/javascript/flavours/glitch/features/account_edit/modals/fields_reorder_modal.tsx index 37a57d68c1..e355731c72 100644 --- a/app/javascript/flavours/glitch/features/account_edit/modals/fields_reorder_modal.tsx +++ b/app/javascript/flavours/glitch/features/account_edit/modals/fields_reorder_modal.tsx @@ -212,11 +212,9 @@ export const ReorderFieldsModal: FC = ({ 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); diff --git a/app/javascript/flavours/glitch/reducers/slices/profile_edit.ts b/app/javascript/flavours/glitch/reducers/slices/profile_edit.ts index ae4a8d2537..f1afea5592 100644 --- a/app/javascript/flavours/glitch/reducers/slices/profile_edit.ts +++ b/app/javascript/flavours/glitch/reducers/slices/profile_edit.ts @@ -221,7 +221,12 @@ export const patchProfile = createDataLoadingThunk( `${profileEditSlice.name}/patchProfile`, (params: Partial) => apiPatchProfile(params), transformProfile, - { useLoadingBar: false }, + { + useLoadingBar: false, + condition(_, { getState }) { + return !getState().profileEdit.isPending; + }, + }, ); export const selectFieldById = createAppSelector(