diff --git a/core/src/main/java/bisq/core/filter/Filter.java b/core/src/main/java/bisq/core/filter/Filter.java index 41bc9521ae8..a642c9511c9 100644 --- a/core/src/main/java/bisq/core/filter/Filter.java +++ b/core/src/main/java/bisq/core/filter/Filter.java @@ -348,6 +348,7 @@ public String toString() { return "Filter{" + "\n bannedOfferIds=" + bannedOfferIds + ",\n bannedNodeAddress=" + bannedNodeAddress + + ",\n bannedAutoConfExplorers=" + bannedAutoConfExplorers + ",\n bannedPaymentAccounts=" + bannedPaymentAccounts + ",\n bannedCurrencies=" + bannedCurrencies + ",\n bannedPaymentMethods=" + bannedPaymentMethods + @@ -365,12 +366,12 @@ public String toString() { ",\n mediators=" + mediators + ",\n refundAgents=" + refundAgents + ",\n bannedAccountWitnessSignerPubKeys=" + bannedAccountWitnessSignerPubKeys + - ",\n bannedPrivilegedDevPubKeys=" + bannedPrivilegedDevPubKeys + ",\n btcFeeReceiverAddresses=" + btcFeeReceiverAddresses + ",\n creationDate=" + creationDate + + ",\n bannedPrivilegedDevPubKeys=" + bannedPrivilegedDevPubKeys + ",\n extraDataMap=" + extraDataMap + + ",\n ownerPubKey=" + ownerPubKey + ",\n disableAutoConf=" + disableAutoConf + - ",\n bannedAutoConfExplorers=" + bannedAutoConfExplorers + "\n}"; } } diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/FilterWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/FilterWindow.java index b56b317090e..167c4e6bd9f 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/FilterWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/FilterWindow.java @@ -27,6 +27,7 @@ import bisq.core.filter.PaymentAccountFilter; import bisq.core.locale.Res; +import bisq.common.UserThread; import bisq.common.app.DevEnv; import bisq.common.config.Config; @@ -223,12 +224,16 @@ private void addContent() { ); // We remove first the old filter + // We delay a bit with adding as it seems that the instant add/remove calls lead to issues that the + // remove msg was rejected (P2P storage should handle it but seems there are edge cases where its not + // working as expected) if (filterManager.canRemoveDevFilter(privKeyString)) { filterManager.removeDevFilter(privKeyString); + UserThread.runAfter(() -> addDevFilter(removeFilterMessageButton, privKeyString, newFilter), + 5); + } else { + addDevFilter(removeFilterMessageButton, privKeyString, newFilter); } - filterManager.addDevFilter(newFilter, privKeyString); - removeFilterMessageButton.setDisable(filterManager.getDevFilter() == null); - hide(); } else { new Popup().warning(Res.get("shared.invalidKey")).onClose(this::blurAgain).show(); } @@ -258,6 +263,12 @@ private void addContent() { GridPane.setMargin(hBox, new Insets(10, 0, 0, 0)); } + private void addDevFilter(Button removeFilterMessageButton, String privKeyString, Filter newFilter) { + filterManager.addDevFilter(newFilter, privKeyString); + removeFilterMessageButton.setDisable(filterManager.getDevFilter() == null); + hide(); + } + private void setupFieldFromList(InputTextField field, List values) { if (values != null) field.setText(String.join(", ", values));