Fix tests

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-09-23 15:28:21 +02:00
parent 5eb0d206a2
commit 730b06eda7
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF

View file

@ -758,6 +758,10 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
return ret;
}
private boolean isCurrentDirectoryRoot() {
return currentDirectory != null && currentDirectory.isRootDirectory();
}
/**
* Change the adapted directory for a new one
*
@ -793,10 +797,10 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
}
// TODO refactor add DrawerState instead of using static menuItemId
if (DrawerActivity.menuItemId == R.id.nav_shared && currentDirectory.isRootDirectory()) {
if (DrawerActivity.menuItemId == R.id.nav_shared && isCurrentDirectoryRoot()) {
mFiles = filterSharedFiles(mFiles);
}
if (DrawerActivity.menuItemId == R.id.nav_favorites && currentDirectory.isRootDirectory()) {
if (DrawerActivity.menuItemId == R.id.nav_favorites && isCurrentDirectoryRoot()) {
mFiles = filterFavoriteFiles(mFiles);
}