fix(email): prevent infinite loop when updating templates

This commit is contained in:
Darren Yu 2025-08-21 22:29:23 +08:00
parent f7cbaf83e2
commit d75662479e
No known key found for this signature in database
GPG Key ID: 2D69AA5646405984

View File

@ -72,6 +72,7 @@ const EmailTemplateEditor: React.FC<EmailTemplateEditorProps> = ({ value, onChan
useEffect(() => {
if (templates.length > 0 && !isUpdatingFromProp.current) {
onChange(JSON.stringify(templates));
isUpdatingFromProp.current = true; // Prevent infinite loop
}
}, [templates, onChange]);