diff --git a/apps/files_sharing/src/files_views/shares.ts b/apps/files_sharing/src/files_views/shares.ts index 112bc2909988b..629936161b868 100644 --- a/apps/files_sharing/src/files_views/shares.ts +++ b/apps/files_sharing/src/files_views/shares.ts @@ -15,6 +15,7 @@ import { loadState } from '@nextcloud/initial-state' import { t } from '@nextcloud/l10n' import { ShareType } from '@nextcloud/sharing' import { getContents, isFileRequest } from '../services/SharingService.ts' +import { getCapabilities } from '@nextcloud/capabilities' export const sharesViewId = 'shareoverview' export const sharedWithYouViewId = 'sharingin' @@ -80,22 +81,25 @@ export default () => { })) } - Navigation.register(new View({ - id: sharingByLinksViewId, - name: t('files_sharing', 'Shared by link'), - caption: t('files_sharing', 'List of files that are shared by link.'), + // Don't show this view if sharing by link is disabled. + if (getCapabilities().files_sharing.public.enabled) { + Navigation.register(new View({ + id: sharingByLinksViewId, + name: t('files_sharing', 'Shared by link'), + caption: t('files_sharing', 'List of files that are shared by link.'), - emptyTitle: t('files_sharing', 'No shared links'), - emptyCaption: t('files_sharing', 'Files and folders you shared by link will show up here'), + emptyTitle: t('files_sharing', 'No shared links'), + emptyCaption: t('files_sharing', 'Files and folders you shared by link will show up here'), - icon: LinkSvg, - order: 3, - parent: sharesViewId, + icon: LinkSvg, + order: 3, + parent: sharesViewId, - columns: [], + columns: [], - getContents: () => getContents(false, true, false, false, [ShareType.Link]), - })) + getContents: () => getContents(false, true, false, false, [ShareType.Link]), + })) + } Navigation.register(new View({ id: fileRequestViewId,