Skip to content

Commit

Permalink
Merge pull request #2196 from TeamAmaze/bugfix/2195
Browse files Browse the repository at this point in the history
Reopen SMB dialog on failed load list
  • Loading branch information
VishalNehra authored Jan 9, 2021
2 parents ebe77dd + 2966422 commit 9213942
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ protected Pair<OpenMode, ArrayList<LayoutElementParcelable>> doInBackground(Void
return null;
} catch (SmbException | NullPointerException e) {
e.printStackTrace();
nullCheckOrInterrupt(mainFragment, this).reauthenticateSmb();
return null;
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import com.amaze.filemanager.R;
import com.amaze.filemanager.adapters.RecyclerAdapter;
import com.amaze.filemanager.adapters.data.LayoutElementParcelable;
import com.amaze.filemanager.application.AppConfig;
import com.amaze.filemanager.asynchronous.asynctasks.DeleteTask;
import com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask;
import com.amaze.filemanager.asynchronous.handlers.FileHandler;
Expand Down Expand Up @@ -948,11 +949,11 @@ public void loadlist(final String path, final boolean back, final OpenMode openM
getBoolean(PREFERENCE_SHOW_THUMB),
getBoolean(PREFERENCE_SHOW_HIDDENFILES),
(data) -> {
mSwipeRefreshLayout.setRefreshing(false);
if (data != null && data.second != null) {
boolean isPathLayoutGrid =
dataUtils.getListOrGridForPath(path, DataUtils.LIST) == DataUtils.GRID;
setListElements(data.second, back, path, data.first, false, isPathLayoutGrid);
mSwipeRefreshLayout.setRefreshing(false);
}
});
loadFilesListTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
Expand Down Expand Up @@ -1320,6 +1321,7 @@ public void reauthenticateSmb() {
.runOnUiThread(
() -> {
int i;
AppConfig.toast(requireContext(), getString(R.string.unknown_error));
if ((i = dataUtils.containsServer(smbPath)) != -1) {
getMainActivity()
.showSMBDialog(dataUtils.getServers().get(i)[0], smbPath, true);
Expand Down

0 comments on commit 9213942

Please sign in to comment.