dont set whitelist until click set button in dialog

This commit is contained in:
miloschwartz
2026-06-09 14:36:50 -07:00
parent 6581ccafa3
commit cdb43d9658
2 changed files with 18 additions and 30 deletions
@@ -207,19 +207,11 @@ export function PolicyAuthStackSectionCreate({
active={Boolean(emailWhitelistEnabled)}
onConfigure={() => setEditingMethod("email")}
onToggle={(active) =>
handleToggle(
"email",
active,
() =>
parentForm.setValue(
"emailWhitelistEnabled",
false
),
() =>
parentForm.setValue(
"emailWhitelistEnabled",
true
)
handleToggle("email", active, () =>
parentForm.setValue(
"emailWhitelistEnabled",
false
)
)
}
disabled={!emailEnabled}
@@ -266,12 +258,13 @@ export function PolicyAuthStackSectionCreate({
onOpenChange={(open) => !open && closeCredenza()}
emailEnabled={emailEnabled}
emails={emails}
onSave={(value) =>
onSave={(value) => {
parentForm.setValue(
"emails",
value as PolicyFormValues["emails"]
)
}
);
parentForm.setValue("emailWhitelistEnabled", true);
}}
/>
<HeaderAuthCredenza