mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
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:
commit
13bcd6bfdd
2 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue