File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
owncloudApp/src/main/java/com/owncloud/android/presentation/files/details Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -126,14 +126,7 @@ class FileDetailsFragment : FileFragment() {
126126 super .onViewCreated(view, savedInstanceState)
127127 isMultiPersonal = requireArguments().getBoolean(ARG_IS_MULTIPERSONAL )
128128
129- collectLatestLifecycleFlow(fileDetailsViewModel.currentFile) { ocFileWithSyncInfo: OCFileWithSyncInfo ? ->
130- if (ocFileWithSyncInfo != null ) {
131- file = ocFileWithSyncInfo.file
132- updateDetails(ocFileWithSyncInfo)
133- } else {
134- requireActivity().onBackPressed()
135- }
136- }
129+ observeCurrentFile()
137130
138131 collectLatestLifecycleFlow(fileDetailsViewModel.appRegistryMimeType) { appRegistryMimeType ->
139132 if (appRegistryMimeType != null ) {
@@ -602,6 +595,17 @@ class FileDetailsFragment : FileFragment() {
602595 fileOperationsViewModel.setLastUsageFile(fileWaitingToPreview)
603596 }
604597
598+ private fun observeCurrentFile () {
599+ collectLatestLifecycleFlow(fileDetailsViewModel.currentFile) { ocFileWithSyncInfo: OCFileWithSyncInfo ? ->
600+ if (ocFileWithSyncInfo != null ) {
601+ file = ocFileWithSyncInfo.file
602+ updateDetails(ocFileWithSyncInfo)
603+ } else {
604+ requireActivity().onBackPressed()
605+ }
606+ }
607+ }
608+
605609 override fun updateViewForSyncInProgress () {
606610 // Not yet implemented
607611 }
You can’t perform that action at this time.
0 commit comments