Merge pull request #11037 from nextcloud/e2eEncryptedOption

Only show "set encrypted" if folder is empty and has no empty files/folder in it
This commit is contained in:
Álvaro Brey 2022-11-16 12:34:34 +01:00 committed by GitHub
commit 13bcd6bfdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -77,6 +77,7 @@ class FileMenuFilterIT : AbstractIT() {
every { mockOperationsServiceBinder.isSynchronizing(any(), any()) } returns false
every { mockComponentsGetter.operationsServiceBinder } returns mockOperationsServiceBinder
every { mockStorageManager.getFileById(any()) } returns OCFile("/")
every { mockStorageManager.getFolderContent(any(), any()) } returns ArrayList<OCFile>()
}
@Test

View file

@ -594,7 +594,11 @@ public class FileMenuFilter {
if (isSingleSelection()) {
OCFile file = files.iterator().next();
return file.isFolder() && file.getFileLength() == EMPTY_FILE_LENGTH;
boolean noChildren = componentsGetter
.getStorageManager()
.getFolderContent(file, false).size() == EMPTY_FILE_LENGTH;
return file.isFolder() && file.getFileLength() == EMPTY_FILE_LENGTH && noChildren;
} else {
return false;
}