Skip to content

Commit

Permalink
Merge pull request #1510 from robustTechie/sync_switch
Browse files Browse the repository at this point in the history
fix: Delete elements from document list in identifier
  • Loading branch information
AbhilashG97 authored Aug 17, 2020
2 parents fb77683 + e039b08 commit 28b0e07
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ public void onRequestPermissionsResult(int requestCode,
public void showDocumentList(final List<Document> documents) {
mDocumentList = documents;
mDocumentListAdapter.setDocuments(mDocumentList);
mDocumentListAdapter.notifyDataSetChanged();

if (documents.isEmpty()) {
showEmptyDocuments();
} else {
if (ll_error.getVisibility() == View.VISIBLE) {
ll_error.setVisibility(View.GONE);
}
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,7 @@ public void onError(Throwable e) {
@Override
public void onNext(List<Document> documents) {
getMvpView().showProgressbar(false);
if (!documents.isEmpty()) {
getMvpView().showDocumentList(documents);
} else {
getMvpView().showEmptyDocuments();
}

getMvpView().showDocumentList(documents);
}
}));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ public void testLoadDocumentEmptyList() {
stubDataManagerGetDocuments(Observable.just(emptyDocuments));

mDocumentListPresenter.loadDocumentList(entityType, entityId);

verify(mDocumentListMvpView).showEmptyDocuments();

verify(mDocumentListMvpView, never()).showDocumentList(documentList);
verify(mDocumentListMvpView, never()).showFetchingError(R.string.failed_to_fetch_documents);
}
Expand Down

0 comments on commit 28b0e07

Please sign in to comment.