Only show groups header in the sidebar, if groups are available

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/10283/head
Julius Härtl 2018-07-18 14:37:19 +07:00
parent 1a0792b083
commit c5e82fc21c
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 10 additions and 5 deletions

@ -301,11 +301,16 @@ export default {
}
// Add separator
let separator = {
caption: true,
text: t('settings', 'Groups')
};
groups.unshift(separator);
let realGroups = groups.find((group) => {return group.id !== 'disabled' && group.id !== 'admin'});
realGroups = typeof realGroups === 'undefined' ? [] : realGroups;
realGroups = Array.isArray(realGroups) ? realGroups : [realGroups];
if (realGroups.length > 0) {
let separator = {
caption: true,
text: t('settings', 'Groups')
};
groups.unshift(separator);
}
// Add everyone group