Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align shared by link behaviour with other platforms #3007

Merged
merged 1 commit into from
Nov 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ class FileDataStorageManager {
val sharedByLinkFilesFromCurrentAccount: Vector<OCFile>
get() {
val allSharedFiles = Vector<OCFile>()
val result = Vector<OCFile>()
var cursorOnShared: Cursor? = null
try {
cursorOnShared = contentResolver?.query(
Expand All @@ -258,21 +257,7 @@ class FileDataStorageManager {
cursorOnShared?.close()
}

if (allSharedFiles.isNotEmpty()) {
val allSharedDirs = Vector<Long>()
for (file in allSharedFiles) {
if (file.isFolder) {
allSharedDirs.add(file.fileId)
}
}
for (file in allSharedFiles) {
if (file.isFolder || (!file.isFolder && !allSharedDirs.contains(file.parentId))) {
result.add(file)
}
}
}
result.sort()
return result
return allSharedFiles.apply { sort() }
}

fun getFileByPath(path: String): OCFile? {
Expand Down