From 3ed3ce4e05b8e82da4181a82421383a91dbfff23 Mon Sep 17 00:00:00 2001 From: Echo Date: Wed, 11 Mar 2026 13:09:54 +0100 Subject: [PATCH] [Glitch] Profile editing: Fix bug with reordering Port f971670c620db61da4dadff07efe86b51c145bfd to glitch-soc Signed-off-by: Claire --- .../features/account_edit/modals/fields_reorder_modal.tsx | 6 ++---- .../flavours/glitch/reducers/slices/profile_edit.ts | 7 ++++++- 2 files changed, 8 insertions(+), 5 deletions(-) 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(