Only modify document title if running standalone (#3071)

This commit is contained in:
Roland Schilter
2018-02-20 18:16:04 +00:00
committed by GitHub
parent 6cc2026791
commit 6ddc57d047

View File

@@ -1,12 +1,16 @@
const PREFIX = document.title || 'Weave Scope';
const SEPARATOR = ' - ';
const STANDALONE_TITLE = 'Weave Scope';
const STANDALONE = document.title === STANDALONE_TITLE;
const SEPARATOR = ' ';
export function setDocumentTitle(title) {
if (!STANDALONE) {
return;
}
if (title) {
document.title = [PREFIX, title].join(SEPARATOR);
document.title = [STANDALONE_TITLE, title].join(SEPARATOR);
} else {
document.title = PREFIX;
document.title = STANDALONE_TITLE;
}
}