Skip to content

Commit

Permalink
Merge pull request #50213 from nextcloud/backport/fix-files-title
Browse files Browse the repository at this point in the history
[stable29] fix(files): Restore page title (folder - view - product)
  • Loading branch information
AndyScherzinger authored Jan 26, 2025
2 parents 34bccd1 + 47fda0d commit d061797
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
14 changes: 13 additions & 1 deletion apps/files/src/views/FilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,12 @@ export default defineComponent({
},

pageHeading(): string {
return this.currentView?.name ?? this.t('files', 'Files')
const title = this.currentView?.name ?? t('files', 'Files')

if (this.currentFolder === undefined || this.dir === '/') {
return title
}
return `${this.currentFolder.displayname} - ${title}`
},

/**
Expand Down Expand Up @@ -440,6 +445,13 @@ export default defineComponent({
},

watch: {
/**
* Update the window title to match the page heading
*/
pageHeading() {
document.title = `${this.pageHeading} - ${getCapabilities().theming?.productName ?? 'Nextcloud'}`
},

currentView(newView, oldView) {
if (newView?.id === oldView?.id) {
return
Expand Down
4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

0 comments on commit d061797

Please sign in to comment.