n8n/packages/editor-ui/src/composables/useTitleChange.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
485 B
TypeScript
Raw Normal View History

import type { WorkflowTitleStatus } from '@/Interface';
export function useTitleChange() {
const titleSet = (workflow: string, status: WorkflowTitleStatus) => {
let icon = '⚠️';
if (status === 'EXECUTING') {
icon = '🔄';
} else if (status === 'IDLE') {
icon = '▶️';
}
window.document.title = `n8n - ${icon} ${workflow}`;
};
const titleReset = () => {
window.document.title = 'n8n - Workflow Automation';
};
return {
titleSet,
titleReset,
};
}