From 4761b71105d039b359379077a668d3116342467d Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 6 May 2024 11:03:58 -0400 Subject: [PATCH] remove repeated popups on offer taken error --- .../availability/tasks/ProcessOfferAvailabilityResponse.java | 2 +- .../desktop/main/offer/takeoffer/TakeOfferDataModel.java | 5 ++++- .../desktop/main/offer/takeoffer/TakeOfferViewModel.java | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/haveno/core/offer/availability/tasks/ProcessOfferAvailabilityResponse.java b/core/src/main/java/haveno/core/offer/availability/tasks/ProcessOfferAvailabilityResponse.java index cb78a6feb4..e49235e807 100644 --- a/core/src/main/java/haveno/core/offer/availability/tasks/ProcessOfferAvailabilityResponse.java +++ b/core/src/main/java/haveno/core/offer/availability/tasks/ProcessOfferAvailabilityResponse.java @@ -54,7 +54,7 @@ public class ProcessOfferAvailabilityResponse extends Task { }, - 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 + }); } } diff --git a/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferViewModel.java b/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferViewModel.java index 9382ca9d77..559ad75f74 100644 --- a/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferViewModel.java +++ b/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferViewModel.java @@ -374,8 +374,8 @@ class TakeOfferViewModel extends ActivatableWithDataModel 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;