mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
The app goes directly to root folder when the current folder does not exist anymore after refreshing with server
This commit is contained in:
parent
79493448d9
commit
ec85b4225e
1 changed files with 16 additions and 1 deletions
|
@ -881,7 +881,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
String.format(getString(R.string.sync_current_folder_was_removed), mDirectories.getItem(0)),
|
||||
Toast.LENGTH_LONG)
|
||||
.show();
|
||||
onBackPressed();
|
||||
jumpToRoot();
|
||||
|
||||
} else {
|
||||
if (currentFile == null && !getFile().isDirectory()) {
|
||||
|
@ -978,6 +978,21 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
}
|
||||
|
||||
|
||||
public void jumpToRoot() {
|
||||
OCFileListFragment listOfFiles = getListOfFilesFragment();
|
||||
if (listOfFiles != null) { // should never be null, indeed
|
||||
while (mDirectories.getCount() > 1) {
|
||||
popDirname();
|
||||
}
|
||||
OCFile root = mStorageManager.getFileByPath(OCFile.PATH_SEPARATOR);
|
||||
listOfFiles.listDirectory(root);
|
||||
setFile(listOfFiles.getCurrentFile());
|
||||
startSyncFolderOperation(root);
|
||||
}
|
||||
cleanSecondFragment();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue