diff --git a/applications/voting/vote.js b/applications/voting/vote.js index 1809db5..9d9bd25 100644 --- a/applications/voting/vote.js +++ b/applications/voting/vote.js @@ -445,14 +445,14 @@ // Don't recreate the prompt if we already have the matching question if (message.poll.question == poll.question && !poll.canHostVote) return; + pollStats = {iterations: 0, responses: {}, winnerSelected: false, winnerName: "", votesReceived: 0, votesCounted: 0 } + poll = message.poll; // Play sound for new poll _emitSound("new_prompt"); _emitEvent({type: "poll_prompt", poll: message.poll}); poll.question = message.poll.question; - - pollStats.winnerSelected = false; } if (message.type == "vote_count") { diff --git a/applications/voting/vote.qml b/applications/voting/vote.qml index 2efb309..ba6c38a 100644 --- a/applications/voting/vote.qml +++ b/applications/voting/vote.qml @@ -693,7 +693,6 @@ Rectangle { anchors.fill: parent onClicked: { _clearHost(); - _clearResults(); _changePage("poll_host_view"); votes_tallied = false; } @@ -899,13 +898,6 @@ Rectangle { } } - function _clearResults(){ - poll_winner.text = "---" - tally_votes_itterations.text = "-" - tally_votes_counted.text = "-" - tally_votes_received.text = "0" - } - function _clearHost(){ poll_to_respond_title.text = "" poll_option_model_host.clear(); @@ -975,7 +967,7 @@ Rectangle { _changePage("poll_client_view"); // Clear the results page - _clearResults() + _populateResults(); // Set the options break;