diff --git a/src/app/pages/admin/index.js b/src/app/pages/admin/index.js index e5bdeb324..cccebc8fe 100644 --- a/src/app/pages/admin/index.js +++ b/src/app/pages/admin/index.js @@ -6,7 +6,6 @@ import PerformanceFeatureSettings from '../settings/performanceFeatureSettings'; import { Container, Page } from '@newfold/ui-component-library'; const Admin = () => { - return ( diff --git a/src/app/pages/settings/helpCenterSettings.js b/src/app/pages/settings/helpCenterSettings.js index f19ad9d18..75ed9d4c1 100644 --- a/src/app/pages/settings/helpCenterSettings.js +++ b/src/app/pages/settings/helpCenterSettings.js @@ -38,6 +38,7 @@ const HelpCenterSettings = () => { setHelpCenter( ! helpCenter ); } else { setHelpCenterLocked( true ); + setError( true ); notifyError(); } } ); diff --git a/src/app/pages/settings/performanceFeatureSettings.js b/src/app/pages/settings/performanceFeatureSettings.js index 100cde219..beab8ce94 100644 --- a/src/app/pages/settings/performanceFeatureSettings.js +++ b/src/app/pages/settings/performanceFeatureSettings.js @@ -37,6 +37,7 @@ const PerformanceFeatureSettings = () => { setPerformance( ! performance ); } else { setPerformanceLocked( true ); + setError( true ); notifyError(); } } ); diff --git a/src/app/pages/settings/stagingFeatureSettings.js b/src/app/pages/settings/stagingFeatureSettings.js index 4a8784804..599d17cfc 100644 --- a/src/app/pages/settings/stagingFeatureSettings.js +++ b/src/app/pages/settings/stagingFeatureSettings.js @@ -34,6 +34,7 @@ const StagingFeatureSettings = () => { setStaging( ! staging ); } else { setStagingLocked( true ); + setError( true ); notifyError(); } } ); diff --git a/src/app/pages/settings/wonderBlocksSettings.js b/src/app/pages/settings/wonderBlocksSettings.js index df0779cfc..f1b489be0 100644 --- a/src/app/pages/settings/wonderBlocksSettings.js +++ b/src/app/pages/settings/wonderBlocksSettings.js @@ -40,6 +40,7 @@ const WonderBlocksSettings = () => { setWonderBlocks( ! wonderBlocks ); } else { setWonderBlocksLocked( true ); + setError( true ); notifyError(); } } ); diff --git a/src/app/util/helpers.js b/src/app/util/helpers.js index 50e5f7daa..0af5e1209 100644 --- a/src/app/util/helpers.js +++ b/src/app/util/helpers.js @@ -70,10 +70,12 @@ export const featureToggle = async ( featureName, thenCallback ) => { }; /** - * Helper to update UI elements with a class - * @param {boolean} enabled whether the element should be activated or deactivated - * @param {string} selector the css selector to find the element - * @param {string} className the css class to add/remove + * Helper to update UI elements as features are enabled/disabled + * + * @param {string} selector css selector to find the element + * @param {boolean} enabled whether the element is now activated/deactivated + * @param {string} className the css class to add/remove - default 'nfd-disabled' + * @param {boolean} forceReload whether this update requires a forced page reload - default false */ export const updateUI = ( selector,