Skip to content

Commit

Permalink
fix(files): Restore page title (folder - view - product)
Browse files Browse the repository at this point in the history
* Folder: Current folder if not root
* View: Name of current view
* Product: Nextcloud

Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Jan 16, 2025
1 parent 99fc39e commit 131c4dc
Showing 1 changed file with 13 additions and 1 deletion.
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

0 comments on commit 131c4dc

Please sign in to comment.