Skip to content

Commit

Permalink
fix: added a condition to distinguish between FileDisplayActivity a…
Browse files Browse the repository at this point in the history
…nd `FolderPickerActivity` for refresh operation
  • Loading branch information
joragua committed Nov 29, 2024
1 parent 0a834b4 commit 73336c8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,11 @@ class MainFileListFragment : Fragment(),
// Observe the current folder displayed
collectLatestLifecycleFlow(mainFileListViewModel.currentFolderDisplayed) { currentFolderDisplayed: OCFile ->
fileActions?.onCurrentFolderUpdated(currentFolderDisplayed, mainFileListViewModel.getSpace())
val fileListOption = (requireActivity() as FileDisplayActivity).fileListOption
val fileListOption = if (isPickingAFolder()) {
mainFileListViewModel.fileListOption.value
} else {
(requireActivity() as FileDisplayActivity).fileListOption
}
val refreshFolderNeeded = fileListOption.isAllFiles() ||
(!fileListOption.isAllFiles() && currentFolderDisplayed.remotePath != ROOT_PATH && !fileListOption.isAvailableOffline())
if (refreshFolderNeeded) {
Expand Down

0 comments on commit 73336c8

Please sign in to comment.