From bbc3943563b3dbdbf0a12f81fe8bdc30a02da917 Mon Sep 17 00:00:00 2001 From: AmitPaul-akp <95674193+AmitPaul-akp@users.noreply.github.com> Date: Fri, 22 May 2026 15:00:41 +0600 Subject: [PATCH] fix: preserve "Enable Mobile Responsive" toggle on notification update (#81297) The useEffect in WrapperWithLoader fires whenever builderContext.values.type changes, including the moment an existing notification's saved values populate the form on edit. It was unconditionally calling setFieldValue("is_mobile_responsive", nx_type !== "custom"), which silently overwrote the user's saved toggle (e.g. false) back to true before save, so updating any existing notification re-enabled mobile responsive every time. Guard the override behind !builderValues?.nx_id so it only applies when creating a new notification. For existing entries the user's saved value is preserved. Fluent Boards task: https://projects.startise.com/wp-admin/admin.php?page=fluent-boards#/boards/19/tasks/81297-bug-fix-notificationx-mobile-responsive-setting-automatically-re-enables-after-notification-update Co-Authored-By: Claude Opus 4.7 (1M context) --- nxdev/notificationx/components/WrapperWithLoader.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nxdev/notificationx/components/WrapperWithLoader.tsx b/nxdev/notificationx/components/WrapperWithLoader.tsx index 4156533c..8d5eb972 100644 --- a/nxdev/notificationx/components/WrapperWithLoader.tsx +++ b/nxdev/notificationx/components/WrapperWithLoader.tsx @@ -22,7 +22,9 @@ const WrapperWithLoader: React.FC<{ isLoading?: boolean, classes?: string, div?: : (forcedDesktopValues.includes(nx_type) ? 'for_desktop' : (builderContext?.values?.themes_tab || 'for_desktop')); - builderContext.setFieldValue( "is_mobile_responsive", nx_type !== "custom"); + if ( ! builderValues?.nx_id ) { + builderContext.setFieldValue( "is_mobile_responsive", nx_type !== "custom" ); + } setTimeout(() => { if ( nx_type !== 'notification_bar' ) { builderContext.setFieldValue("themes_tab", themeTabValue);