Fix host window reset if can vote and user join.

Fixed recast vote if already tallied.
This commit is contained in:
armored-dragon 2024-09-12 16:16:08 -05:00
parent a175102473
commit 202198cbc5
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B
2 changed files with 7 additions and 2 deletions

View file

@ -12,11 +12,11 @@
/* global Script Tablet Messages MyAvatar Uuid*/
// TODO: Documentation
// FIXME: Reset create_poll view when switching screens
// FIXME: Handle ties: kill both of tied results
// FIXME: Handle ties: Last two standing are tied.
// FIXME: Host closes window does not return them to client view when applicable
// FIXME: User joining in poll results mode causes window to switch to vote mode only if host can vote
(() => {
"use strict";

View file

@ -593,6 +593,7 @@ Rectangle {
RowLayout {
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
visible: !votes_tallied
// Recast vote
Rectangle {
@ -927,7 +928,6 @@ Rectangle {
// Populate the client view of the current question and options
case "poll_prompt":
current_page = "poll_client_view";
active_polls_list.index_selected = -1; // Unselect whatever poll was selected (If one was selected)
// Clear options
poll_option_model.clear();
@ -939,6 +939,10 @@ Rectangle {
poll_option_model.append({option: option, rank: 0})
}
if (is_host) return;
current_page = "poll_client_view";
// Clear the results page
_clearResults()
@ -979,6 +983,7 @@ Rectangle {
poll_winner.text = message.winner
tally_votes_itterations.text = message.rounds
tally_votes_counted.text = message.votesCounted
votes_tallied = true
break;
case "received_vote":
tally_votes_received.text = message.voteCount