refactor(editor): Change document title function to be easier to update (no-changelog) (#17627)

This commit is contained in:
Alex Grozav
2025-07-24 15:39:11 +03:00
committed by GitHub
parent 424c79c14b
commit 0574574b8f

View File

@@ -1,15 +1,18 @@
import { useSettingsStore } from '@/stores/settings.store';
const DEFAULT_TITLE = 'Workflow Automation';
const DEFAULT_TITLE = 'n8n';
const DEFAULT_TAGLINE = 'Workflow Automation';
export function useDocumentTitle() {
const settingsStore = useSettingsStore();
const { releaseChannel } = settingsStore.settings;
const suffix =
!releaseChannel || releaseChannel === 'stable' ? 'n8n' : `n8n[${releaseChannel.toUpperCase()}]`;
!releaseChannel || releaseChannel === 'stable'
? DEFAULT_TITLE
: `${DEFAULT_TITLE}[${releaseChannel.toUpperCase()}]`;
const set = (title: string) => {
const sections = [title || DEFAULT_TITLE, suffix];
const sections = [title || DEFAULT_TAGLINE, suffix];
document.title = sections.join(' - ');
};