remove repeated popups on offer taken error

This commit is contained in:
woodser 2024-05-06 11:03:58 -04:00
parent 399d4e0512
commit 4761b71105
3 changed files with 7 additions and 4 deletions

View File

@ -54,7 +54,7 @@ public class ProcessOfferAvailabilityResponse extends Task<OfferAvailabilityMode
// verify maker signature for trade request
if (!HavenoUtils.isMakerSignatureValid(model.getTradeRequest(), offerAvailabilityResponse.getMakerSignature(), offer.getPubKeyRing())) {
offer.setState(Offer.State.NOT_AVAILABLE);
offer.setState(Offer.State.UNKNOWN); // TODO: using as invalid state
failed("Take offer attempt failed because maker signature is invalid");
return;
}

View File

@ -147,7 +147,10 @@ class TakeOfferDataModel extends OfferDataModel {
this.amount.get(),
() -> {
},
errorMessage -> new Popup().warning(errorMessage).show());
errorMessage -> {
log.warn(errorMessage);
if (offer.getState() != Offer.State.NOT_AVAILABLE) new Popup().warning(errorMessage).show(); // expected and handled elsewhere in UI
});
}
}

View File

@ -374,8 +374,8 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
takeOfferRequested = false;
break;
case REMOVED:
if (!takeOfferRequested)
offerWarning.set(Res.get("takeOffer.failed.offerRemoved"));
// if (takeOfferRequested) // TODO: show any warning or removed is expected?
// offerWarning.set(Res.get("takeOffer.failed.offerRemoved"));
takeOfferRequested = false;
break;