From e90d248de1026200c6134f32b7b104e62ddd69ae Mon Sep 17 00:00:00 2001 From: Novak Zaballa <41410593+novakzaballa@users.noreply.github.com> Date: Wed, 5 Jun 2024 18:22:15 -0400 Subject: [PATCH] fix: Flag update scheduling (#4115) --- frontend/web/components/saveFeatureWithValidation.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/web/components/saveFeatureWithValidation.ts b/frontend/web/components/saveFeatureWithValidation.ts index b2d08aef1036..816b7791269a 100644 --- a/frontend/web/components/saveFeatureWithValidation.ts +++ b/frontend/web/components/saveFeatureWithValidation.ts @@ -1,5 +1,5 @@ -export const saveFeatureWithValidation = (cb: () => void) => { - return () => { +export const saveFeatureWithValidation = (cb: (schedule?: boolean) => void) => { + return (schedule: boolean) => { if (document.getElementById('language-validation-error')) { openConfirm({ body: 'Your remote config value does not pass validation for the language you have selected. Are you sure you wish to save?', @@ -9,7 +9,11 @@ export const saveFeatureWithValidation = (cb: () => void) => { yesText: 'Save', }) } else { - cb() + if (schedule) { + cb(schedule) + } else { + cb() + } } } }