Skip to content

Commit a0ad310

Browse files
committed
fix: show correct toolbar for av.offline view in multi-personal accounts
1 parent f908e6f commit a0ad310

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,9 @@ class FileDisplayActivity : FileActivity(),
969969
// or it will show the root folder one
970970
if (intent.action == ACTION_DETAILS && chosenFile?.remotePath == OCFile.ROOT_PATH && secondFragment is FileDetailsFragment) return
971971

972-
if (chosenFile == null || (chosenFile.remotePath == OCFile.ROOT_PATH && (space == null || isNotProjectSpaceAndMultiPersonalMode(space)))) {
972+
if (chosenFile == null || (chosenFile.remotePath == OCFile.ROOT_PATH && (space == null || isNotProjectSpaceAndMultiPersonalMode(space) ||
973+
isMultiPersonalModeInAvailableOffline(space))
974+
)) {
973975
val title =
974976
when (fileListOption) {
975977
FileListOption.AV_OFFLINE -> getString(R.string.drawer_item_only_available_offline)
@@ -993,7 +995,8 @@ class FileDisplayActivity : FileActivity(),
993995

994996
private fun isNotProjectSpaceAndMultiPersonalMode(space: OCSpace?) = !space!!.isProject && !(space.isPersonal && isMultiPersonal)
995997

996-
998+
private fun isMultiPersonalModeInAvailableOffline(space: OCSpace?) = space!!.isPersonal && isMultiPersonal && fileListOption == FileListOption
999+
.AV_OFFLINE
9971000
/**
9981001
* Updates the view associated to the activity after the finish of an operation trying to
9991002
* remove a file.

0 commit comments

Comments
 (0)