Skip to content

Commit

Permalink
Merge pull request #3356 from stejbac/fix-proposal-table-hide
Browse files Browse the repository at this point in the history
Fix proposal table hide when switching to another screen and back
  • Loading branch information
freimair authored Nov 1, 2019
2 parents d174535 + f5d2493 commit 1999cfb
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ protected void activate() {
});
if (proposalsTableView != null) {
GUIUtil.setFitToRowsForTableView(proposalsTableView, 25, 28, 6, 6);

selectedProposalSubscription = EasyBind.subscribe(proposalsTableView.getSelectionModel().selectedItemProperty(),
this::onSelectProposalResultListItem);
}
GUIUtil.setFitToRowsForTableView(cyclesTableView, 25, 28, 6, 6);
}
Expand All @@ -221,8 +224,6 @@ protected void activate() {
protected void deactivate() {
super.deactivate();

onResultsListItemSelected(null);

phasesView.deactivate();

daoFacade.removeBsqStateListener(this);
Expand Down Expand Up @@ -324,7 +325,7 @@ private void onResultsListItemSelected(CycleListItem item) {

});
});
if (!sb.toString().isEmpty()) {
if (sb.length() != 0) {
new Popup<>().information(Res.get("dao.results.invalidVotes", sb.toString())).show();
}
}
Expand Down Expand Up @@ -355,10 +356,6 @@ private void maybeShowVoteResultErrors(Cycle cycle) {
private void onSelectProposalResultListItem(ProposalListItem item) {
selectedProposalListItem = item;

GUIUtil.removeChildrenFromGridPaneRows(root, 5, gridRow);
gridRow = 3;


if (selectedProposalListItem != null) {
EvaluatedProposal evaluatedProposal = selectedProposalListItem.getEvaluatedProposal();
Optional<Ballot> optionalBallot = daoFacade.getAllValidBallots().stream()
Expand Down Expand Up @@ -495,8 +492,8 @@ private void createProposalsTable() {
proposalsTableView.setItems(sortedProposalList);
sortedProposalList.comparatorProperty().bind(proposalsTableView.comparatorProperty());

proposalList.clear();
proposalList.forEach(ProposalListItem::resetTableRow);
proposalList.clear();

Map<String, Ballot> ballotByProposalTxIdMap = daoFacade.getAllValidBallots().stream()
.collect(Collectors.toMap(Ballot::getTxId, ballot -> ballot));
Expand Down

0 comments on commit 1999cfb

Please sign in to comment.