diff --git a/packages/core/client/src/workflow/WorkflowCanvas.tsx b/packages/core/client/src/workflow/WorkflowCanvas.tsx index 7b7efa1a1..087b3a3f5 100644 --- a/packages/core/client/src/workflow/WorkflowCanvas.tsx +++ b/packages/core/client/src/workflow/WorkflowCanvas.tsx @@ -1,4 +1,4 @@ -import React, { useContext } from 'react'; +import React, { useContext, useEffect } from 'react'; import { Dropdown, Menu, Button } from 'antd'; import { PlusOutlined } from '@ant-design/icons'; import { cx } from '@emotion/css'; @@ -7,6 +7,7 @@ import { useTranslation } from 'react-i18next'; import { useCollection, useCompile, + useDocumentTitle, useResourceActionContext } from '..'; import { Instruction, instructions, Node } from './nodes'; @@ -39,6 +40,12 @@ export function WorkflowCanvas() { const { t } = useTranslation(); const { data, refresh, loading } = useResourceActionContext(); + const { setTitle } = useDocumentTitle(); + useEffect(() => { + const { title } = data?.data ?? {}; + setTitle(`${title ? `${title} - ` : ''}${t('Workflow')}`); + }, [data?.data]); + if (!data?.data && !loading) { return