refactor(editor): Turn titleChange mixin to composable (#6059)

This commit is contained in:
Csaba Tuncsik
2023-04-21 15:48:07 +02:00
committed by GitHub
parent 649389edad
commit 19f540ecf9
7 changed files with 54 additions and 59 deletions

View File

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