mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
fix(email): prevent infinite loop when updating templates
This commit is contained in:
parent
f7cbaf83e2
commit
d75662479e
|
|
@ -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]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue