Skip to content

Commit 5dd20a5

Browse files
committed
dont register personal files_external setting if it's empty
1 parent c5c71c6 commit 5dd20a5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/files_external/lib/AppInfo/Application.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,14 @@ public function __construct(array $urlParams = array()) {
6868
* Register settings templates
6969
*/
7070
public function registerSettings() {
71-
\OCP\App::registerPersonal('files_external', 'personal');
71+
$container = $this->getContainer();
72+
$backendService = $container->query('OCA\\Files_External\\Service\\BackendService');
73+
74+
/** @var \OCA\Files_External\Service\UserGlobalStoragesService $userGlobalStoragesService */
75+
$userGlobalStoragesService = $container->query('OCA\Files_External\Service\UserGlobalStoragesService');
76+
if (count($userGlobalStoragesService->getStorages()) > 0 || $backendService->isUserMountingAllowed()) {
77+
\OCP\App::registerPersonal('files_external', 'personal');
78+
}
7279
}
7380

7481
/**

0 commit comments

Comments
 (0)