From 09e68fa01fe5d690bb8805022e74dc922d3d7d25 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Sun, 27 Oct 2019 19:12:57 -0500 Subject: [PATCH] Check for result phase at activate method Fixes https://github.com/bisq-network/bisq/issues/3487 --- .../main/dao/governance/result/VoteResultView.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/result/VoteResultView.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/result/VoteResultView.java index f0a10f72f66..7cc6e38f59f 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/result/VoteResultView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/result/VoteResultView.java @@ -202,6 +202,7 @@ protected void activate() { cyclesTableView.getSelectionModel().selectedItemProperty().addListener(selectedVoteResultListItemListener); if (daoStateService.isParseBlockChainComplete()) { + checkForResultPhase(daoStateService.getChainHeight()); fillCycleList(); } @@ -238,7 +239,11 @@ protected void deactivate() { @Override public void onParseBlockCompleteAfterBatchProcessing(Block block) { - int chainHeight = daoStateService.getChainHeight(); + checkForResultPhase(daoStateService.getChainHeight()); + fillCycleList(); + } + + private void checkForResultPhase(int chainHeight) { if (periodService.getFirstBlockOfPhase(chainHeight, DaoPhase.Phase.RESULT) == chainHeight) { // We had set the cycle initially but at the vote result we want to update it with the actual result. // We remove the empty cycle to make space for the one with the result. @@ -251,8 +256,6 @@ public void onParseBlockCompleteAfterBatchProcessing(Block block) { .findAny(); optionalCurrentCycleListItem.ifPresent(cycleListItemList::remove); } - - fillCycleList(); }