Fixed rehost not repopulating host view, maybe?

This commit is contained in:
armored-dragon 2024-09-06 14:41:30 -05:00
parent 0700c89503
commit fb47e24a65
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B
2 changed files with 11 additions and 1 deletions
applications/voting

View file

@ -66,7 +66,9 @@
if (poll.id != '' && poll.host != myUuid) return joinPoll({id: poll.id});
// If we are hosting a poll, switch the screen
if (poll.id != '' && poll.host == myUuid) return _emitEvent({type: "rehost"});
if (poll.id != '' && poll.host == myUuid) {
return _emitEvent({type: "rehost", prompt: {question: poll.question, options: poll.options}});
}
// Request a list of active polls if we are not already in one
if (poll.id == '') return getActivePolls();

View file

@ -695,6 +695,14 @@ Rectangle {
// Only called when the host closes their tablet and reopens it.
case "rehost":
current_page = "poll_host_view"
poll_to_respond_title.text = message.prompt.question
poll_option_model_host.clear();
for (var option of message.prompt.options){
console.log("adding option "+ option);
poll_option_model_host.append({option: option})
}
break;
}
}