@@ -326,7 +326,7 @@ class FileDisplayActivity : FileActivity(),
326326 0 ,
327327 file.remotePath.lastIndexOf(file.fileName)
328328 )
329- if (storageManager.getFileByPath(parentPath) == null ) {
329+ if (storageManager.getFileByPath(parentPath, file.spaceId ) == null ) {
330330 file = null // not able to know the directory where the file is uploading
331331 }
332332 } else {
@@ -470,7 +470,7 @@ class FileDisplayActivity : FileActivity(),
470470 private fun setSecondFragment (fragment : Fragment ) {
471471 val transaction = supportFragmentManager.beginTransaction()
472472 transaction.replace(R .id.right_fragment_container, fragment, TAG_SECOND_FRAGMENT )
473- transaction.commit ()
473+ transaction.commitNow ()
474474 updateFragmentsVisibility(true )
475475 }
476476
@@ -498,7 +498,7 @@ class FileDisplayActivity : FileActivity(),
498498 if (second != null ) {
499499 val tr = supportFragmentManager.beginTransaction()
500500 tr.remove(second)
501- tr.commit ()
501+ tr.commitNow ()
502502 }
503503 updateFragmentsVisibility(false )
504504 updateToolbar(null )
@@ -916,6 +916,9 @@ class FileDisplayActivity : FileActivity(),
916916 private fun updateToolbar (chosenFileFromParam : OCFile ? , space : OCSpace ? = null) {
917917 val chosenFile = chosenFileFromParam ? : file // If no file is passed, current file decides
918918
919+ // If we come from a preview activity (image or video), not updating toolbar when initializing this activity or it will show the root folder one
920+ if (intent.action == ACTION_DETAILS && chosenFile?.remotePath == OCFile .ROOT_PATH && secondFragment is FileDetailsFragment ) return
921+
919922 if (chosenFile == null || (chosenFile.remotePath == OCFile .ROOT_PATH && (space == null || ! space.isProject))) {
920923 val title =
921924 when (fileListOption) {
0 commit comments