From fcb0ae48b2a38b771fd368321699751ea33756bc Mon Sep 17 00:00:00 2001 From: Jono M Date: Mon, 14 Aug 2023 09:43:59 +0100 Subject: [PATCH] Fixed save button not working when nothing changed (#17709) no issue --- apps/admin-x-settings/src/hooks/useSettingGroup.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/admin-x-settings/src/hooks/useSettingGroup.tsx b/apps/admin-x-settings/src/hooks/useSettingGroup.tsx index 9b6430a406..58b313950f 100644 --- a/apps/admin-x-settings/src/hooks/useSettingGroup.tsx +++ b/apps/admin-x-settings/src/hooks/useSettingGroup.tsx @@ -34,7 +34,6 @@ const useSettingGroup = (): SettingGroupHook => { initialState: settings || [], onSave: async () => { await editSettings?.(changedSettings()); - setEditing(false); } }); @@ -92,7 +91,11 @@ const useSettingGroup = (): SettingGroupHook => { saveState, focusRef, siteData, - handleSave, + handleSave: () => { + const result = handleSave(); + setEditing(false); + return result; + }, handleCancel, updateSetting, handleEditingChange