* Added view attached check to stop callback propagation when view is detached
@@ -183,10 +183,12 @@ import org.jetbrains.annotations.Nullable;
initRepository.init().execute(new Callback<InitResponse>() {
@Override
public void success(final InitResponse initResponse) {
+ if (isViewAttached()) {
expressMetadataList = initResponse.getExpress();
cardsWithSplit = initResponse.getIdsWithSplitAllowed();
loadViewModel();
}
+ }
@Override
public void failure(final ApiException apiException) {
@@ -488,12 +490,14 @@ import org.jetbrains.annotations.Nullable;
initRepository.refresh().enqueue(new Callback<InitResponse>() {
@Override
public void success(final InitResponse initResponse) {
+ if (isViewAttached()) {
expressMetadataList = initResponse.getExpress();
resetPayerCostSelection();
paymentMethodIndex = 0;
getView().clearAdapters();
loadViewModel();
}
+ }
@Override
public void failure(final ApiException apiException) {
