Skip to content

Commit

Permalink
update: setting prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
nirbhayel committed Dec 13, 2024
1 parent a2bc37a commit 8187036
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions modules/settings/assets/js/components/bottom-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -32,7 +32,7 @@ const BottomBar = () => {
) {
try {
await save({
a11y_widget_icon_settings: {
ea11y_widget_icon_settings: {
style: iconDesign,
position: iconPosition,
},
Expand Down
21 changes: 13 additions & 8 deletions modules/settings/assets/js/hooks/use-saved-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const useSavedSettings = () => {
setHideMinimumOptionAlert,
setIconDesign,
setIconPosition,
setPlanData,
} = useSettings();

const result = useSelect((select) => {
Expand All @@ -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]);
Expand Down

0 comments on commit 8187036

Please sign in to comment.