From 81870360835512db31b37963630574e156e3df25 Mon Sep 17 00:00:00 2001 From: Nirbhay Date: Fri, 13 Dec 2024 17:20:26 +0530 Subject: [PATCH] update: setting prefix --- .../assets/js/components/bottom-bar/index.js | 4 ++-- .../assets/js/hooks/use-saved-settings.js | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/settings/assets/js/components/bottom-bar/index.js b/modules/settings/assets/js/components/bottom-bar/index.js index ccd2873..dfbea83 100644 --- a/modules/settings/assets/js/components/bottom-bar/index.js +++ b/modules/settings/assets/js/components/bottom-bar/index.js @@ -19,7 +19,7 @@ const BottomBar = () => { if (selectedMenu.parent === 'widget' && selectedMenu.child === 'menu') { try { await save({ - a11y_widget_menu_settings: widgetMenuSettings, + ea11y_widget_menu_settings: widgetMenuSettings, }); success('Settings saved!'); setHasChanges(false); @@ -32,7 +32,7 @@ const BottomBar = () => { ) { try { await save({ - a11y_widget_icon_settings: { + ea11y_widget_icon_settings: { style: iconDesign, position: iconPosition, }, diff --git a/modules/settings/assets/js/hooks/use-saved-settings.js b/modules/settings/assets/js/hooks/use-saved-settings.js index 7a8c138..1869761 100644 --- a/modules/settings/assets/js/hooks/use-saved-settings.js +++ b/modules/settings/assets/js/hooks/use-saved-settings.js @@ -9,6 +9,7 @@ export const useSavedSettings = () => { setHideMinimumOptionAlert, setIconDesign, setIconPosition, + setPlanData, } = useSettings(); const result = useSelect((select) => { @@ -23,22 +24,26 @@ export const useSavedSettings = () => { useEffect(() => { if (result.hasFinishedResolution) { - if (result?.data?.a11y_widget_menu_settings) { - setWidgetMenuSettings(result.data.a11y_widget_menu_settings); + if (result?.data?.ea11y_widget_menu_settings) { + setWidgetMenuSettings(result.data.ea11y_widget_menu_settings); } - if (result?.data?.a11y_widget_icon_settings?.style) { - setIconDesign(result.data.a11y_widget_icon_settings.style); + if (result?.data?.ea11y_widget_icon_settings?.style) { + setIconDesign(result.data.ea11y_widget_icon_settings.style); } - if (result?.data?.a11y_hide_minimum_active_options_alert) { + if (result?.data?.ea11y_hide_minimum_active_options_alert) { setHideMinimumOptionAlert( - result.data.a11y_hide_minimum_active_options_alert, + result.data.ea11y_hide_minimum_active_options_alert, ); } - if (result?.data?.a11y_widget_icon_settings?.position) { - setIconPosition(result.data.a11y_widget_icon_settings.position); + if (result?.data?.ea11y_widget_icon_settings?.position) { + setIconPosition(result.data.ea11y_widget_icon_settings.position); + } + + if (result?.data?.ea11y_plan_data) { + setPlanData(result.data.ea11y_plan_data); } } }, [result.hasFinishedResolution]);