From 0f41c8d8b87a26cec1058e84654471aac4b964c8 Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 24 Apr 2023 11:45:10 -0400 Subject: [PATCH] always show arbitrator tickets and signed offers view if arbitrator --- .../desktop/main/support/SupportView.java | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/desktop/src/main/java/haveno/desktop/main/support/SupportView.java b/desktop/src/main/java/haveno/desktop/main/support/SupportView.java index 0487c804bb..0ff81ea2a3 100644 --- a/desktop/src/main/java/haveno/desktop/main/support/SupportView.java +++ b/desktop/src/main/java/haveno/desktop/main/support/SupportView.java @@ -155,25 +155,23 @@ public class SupportView extends ActivatableView { private void updateAgentTabs() { PubKeyRing myPubKeyRing = keyRing.getPubKeyRing(); - boolean hasArbitrationCases = !arbitrationManager.getDisputesAsObservableList().isEmpty(); - if (hasArbitrationCases) { - boolean isActiveArbitrator = arbitratorManager.getObservableMap().values().stream() - .anyMatch(e -> e.getPubKeyRing() != null && e.getPubKeyRing().equals(myPubKeyRing)); + boolean isActiveArbitrator = arbitratorManager.getObservableMap().values().stream() + .anyMatch(e -> e.getPubKeyRing() != null && e.getPubKeyRing().equals(myPubKeyRing)); - // In case a arbitrator has become inactive he still might get disputes from pending trades - boolean hasDisputesAsArbitrator = arbitrationManager.getDisputesAsObservableList().stream() - .anyMatch(d -> d.getAgentPubKeyRing().equals(myPubKeyRing)); - if (isActiveArbitrator || hasDisputesAsArbitrator) { - if (arbitratorTab == null) { - arbitratorTab = new Tab(); - arbitratorTab.setClosable(false); - root.getTabs().add(arbitratorTab); - } - if (signedOfferTab == null) { - signedOfferTab = new Tab(); - signedOfferTab.setClosable(false); - root.getTabs().add(signedOfferTab); - } + // In case a arbitrator has become inactive he still might get disputes from pending trades + boolean hasDisputesAsArbitrator = arbitrationManager.getDisputesAsObservableList().stream() + .anyMatch(d -> d.getAgentPubKeyRing().equals(myPubKeyRing)); + + if (isActiveArbitrator || hasDisputesAsArbitrator) { + if (arbitratorTab == null) { + arbitratorTab = new Tab(); + arbitratorTab.setClosable(false); + root.getTabs().add(arbitratorTab); + } + if (signedOfferTab == null) { + signedOfferTab = new Tab(); + signedOfferTab.setClosable(false); + root.getTabs().add(signedOfferTab); } }