From fb47e24a65fd1abcb6de76dc73aca78822363c61 Mon Sep 17 00:00:00 2001 From: armored-dragon Date: Fri, 6 Sep 2024 14:41:30 -0500 Subject: [PATCH] Fixed rehost not repopulating host view, maybe? --- applications/voting/vote.js | 4 +++- applications/voting/vote.qml | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/applications/voting/vote.js b/applications/voting/vote.js index e3c0392..442335b 100644 --- a/applications/voting/vote.js +++ b/applications/voting/vote.js @@ -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(); diff --git a/applications/voting/vote.qml b/applications/voting/vote.qml index 704b897..76baa9b 100644 --- a/applications/voting/vote.qml +++ b/applications/voting/vote.qml @@ -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; } }