Skip to content

Commit 8959504

Browse files
Adapt router.js for setting document title
Signed-off-by: julia.kirschenheuter <julia.kirschenheuter@nextcloud.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent e76715a commit 8959504

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

apps/settings/src/router.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,26 @@ const router = new Router({
5555
component: Users,
5656
props: true,
5757
name: 'users',
58+
meta: {
59+
title: () => {
60+
return t('settings', 'Active users')
61+
},
62+
},
5863
children: [
5964
{
6065
path: ':selectedGroup',
6166
name: 'group',
67+
meta: {
68+
title: (to) => {
69+
if (to.params.selectedGroup === 'admin') {
70+
return t('settings', 'Admins')
71+
}
72+
if (to.params.selectedGroup === 'disabled') {
73+
return t('settings', 'Disabled users')
74+
}
75+
return decodeURIComponent(to.params.selectedGroup)
76+
},
77+
},
6278
component: Users,
6379
},
6480
],
@@ -81,7 +97,8 @@ const router = new Router({
8197
title: async (to) => {
8298
if (to.name === 'apps') {
8399
return t('settings', 'Your apps')
84-
} else if (APPS_SECTION_ENUM[to.params.category]) {
100+
}
101+
if (APPS_SECTION_ENUM[to.params.category]) {
85102
return APPS_SECTION_ENUM[to.params.category]
86103
}
87104
await store.dispatch('getCategories')

0 commit comments

Comments
 (0)