fix(plugin-workflow): fix trigger title when workflow not loaded (#1875)

This commit is contained in:
Junyi 2023-05-17 13:24:50 +07:00 committed by GitHub
parent f4064767c6
commit 0264d89d14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,7 +143,9 @@ export const TriggerConfig = () => {
const [editingTitle, setEditingTitle] = useState<string>('');
const [editingConfig, setEditingConfig] = useState(false);
useEffect(() => {
setEditingTitle(workflow.title ?? typeTitle);
if (workflow) {
setEditingTitle(workflow.title ?? typeTitle);
}
}, [workflow]);
if (!workflow || !workflow.type) {