fix(dashboard): email step block editor content not saved after refresh fixes NV-7106 (#10013)

This commit is contained in:
Dima Grossman
2026-02-11 22:21:48 +02:00
committed by GitHub
parent f81068e0b7
commit 1a6981616d
2 changed files with 18 additions and 0 deletions

View File

@@ -77,6 +77,23 @@ export function EditStepTemplateV2Page() {
return null;
}
const formValues = form.getValues();
const hasFormValues = Object.keys(formValues).length > 0;
const stepControlValues = step.controls.values;
const hasStepControlValues = stepControlValues && Object.keys(stepControlValues).length > 0;
// Wait for form to sync with step values when step has values to sync
// If stepControlValues is undefined, step hasn't loaded yet - don't render
// If stepControlValues is defined but has values, wait for form to sync - don't render until hasFormValues is true
// If stepControlValues is defined but empty {}, that's valid - render immediately
if (stepControlValues === undefined) {
return null;
}
if (hasStepControlValues && !hasFormValues) {
return null;
}
return (
<>
<PageMeta title={`Edit ${step.name} Template`} />

View File

@@ -139,6 +139,7 @@ export function SlashCommandItem(props: SlashCommandItemProps) {
onClick={() => selectItem(groupIndex, commandIndex)}
onMouseEnter={() => onHover(true)}
onMouseLeave={() => onHover(false)}
onMouseDown={(e) => e.preventDefault()}
type="button"
ref={isActive ? activeCommandRef : null}
data-item-key={itemKey}