Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <alper_ozturk@proton.me>
  • Loading branch information
alperozturk96 committed Sep 27, 2024
1 parent b234160 commit 5e61b84
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,10 @@ private List<OCFile> filterFavoriteFiles(Iterable<OCFile> files) {
return ret;
}

private boolean isCurrentDirectoryRoot() {
return currentDirectory != null && currentDirectory.isRootDirectory();
}

/**
* Change the adapted directory for a new one
*
Expand Down Expand Up @@ -793,10 +797,10 @@ public void swapDirectory(
}

// 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);
}

Expand Down

0 comments on commit 5e61b84

Please sign in to comment.