diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java index 9b946631fd8..02ad70fab41 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java @@ -238,13 +238,16 @@ private void doPublishMyProposal(Proposal proposal, Transaction transaction) { daoFacade.publishMyProposal(proposal, transaction, () -> { - if (proposalDisplay != null) - proposalDisplay.clearForm(); - proposalTypeComboBox.getSelectionModel().clearSelection(); if (!DevEnv.isDevMode()) new Popup<>().confirmation(Res.get("dao.tx.published.success")).show(); }, errorMessage -> new Popup<>().warning(errorMessage).show()); + + // We reset UI without waiting for callback as callback might be slow and then the user could create multiple + // proposals. + if (proposalDisplay != null) + proposalDisplay.clearForm(); + proposalTypeComboBox.getSelectionModel().clearSelection(); } @Nullable @@ -377,4 +380,3 @@ private void updateButtonState() { makeProposalButton.setDisable(!inputsValid.get()); } } - diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java index 76ce50cbbce..0fd5b0675ce 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java @@ -50,6 +50,7 @@ import bisq.core.dao.state.model.governance.Proposal; import bisq.core.dao.state.model.governance.Vote; import bisq.core.locale.Res; +import bisq.core.user.Preferences; import bisq.core.util.BSFormatter; import bisq.core.util.BsqFormatter; @@ -111,6 +112,7 @@ public class ProposalsView extends ActivatableView implements Bs private final PhasesView phasesView; private final DaoStateService daoStateService; private final ChangeParamValidator changeParamValidator; + private final Preferences preferences; private final BsqFormatter bsqFormatter; private final BSFormatter btcFormatter; @@ -154,6 +156,7 @@ private ProposalsView(DaoFacade daoFacade, PhasesView phasesView, DaoStateService daoStateService, ChangeParamValidator changeParamValidator, + Preferences preferences, BsqFormatter bsqFormatter, BSFormatter btcFormatter) { this.daoFacade = daoFacade; @@ -161,6 +164,7 @@ private ProposalsView(DaoFacade daoFacade, this.phasesView = phasesView; this.daoStateService = daoStateService; this.changeParamValidator = changeParamValidator; + this.preferences = preferences; this.bsqFormatter = bsqFormatter; this.btcFormatter = btcFormatter; } @@ -514,17 +518,19 @@ private void publishBlindVote(Coin stake) { voteButtonInfoLabel.setText(Res.get("dao.blindVote.startPublishing")); daoFacade.publishBlindVote(stake, () -> { - voteButtonBusyAnimation.stop(); - voteButtonInfoLabel.setText(""); if (!DevEnv.isDevMode()) new Popup<>().feedback(Res.get("dao.blindVote.success")).show(); - - updateViews(); }, exception -> { voteButtonBusyAnimation.stop(); voteButtonInfoLabel.setText(""); new Popup<>().warning(exception.toString()).show(); }); + + // We reset UI without waiting for callback as callback might be slow and then the user could click + // multiple times. + voteButtonBusyAnimation.stop(); + voteButtonInfoLabel.setText(""); + updateViews(); } private void updateStateAfterVote() { @@ -613,7 +619,9 @@ private void updateViews() { } else { String msg = "We found multiple MyVote entries in that cycle. That is not supported by the UI."; log.warn(msg); - new Popup<>().error(msg).show(); + String id = "multipleVotes"; + if (preferences.showAgain(id)) + new Popup<>().warning(msg).dontShowAgainId(id).show(); } voteButton.setVisible(false); voteButton.setManaged(false);