Fix broken page title logic on subpath installs

The base path needs to be accounted for when calculating whether we're on the default route.
This commit is contained in:
Alexander Skvortsov 2020-10-30 14:18:09 -04:00
parent 0cd57d8cba
commit bea0f3c05b

View File

@ -270,7 +270,7 @@ export default class Application {
updateTitle() { updateTitle() {
const count = this.titleCount ? `(${this.titleCount}) ` : ''; const count = this.titleCount ? `(${this.titleCount}) ` : '';
const pageTitleWithSeparator = this.title && m.route.get() !== '/' ? this.title + ' - ' : ''; const pageTitleWithSeparator = this.title && m.route.get() !== this.forum.attribute('basePath') + '/' ? this.title + ' - ' : '';
const title = this.forum.attribute('title'); const title = this.forum.attribute('title');
document.title = count + pageTitleWithSeparator + title; document.title = count + pageTitleWithSeparator + title;
} }