diff --git a/applications/voting/vote.js b/applications/voting/vote.js index 846e1c8..a5e4a0b 100644 --- a/applications/voting/vote.js +++ b/applications/voting/vote.js @@ -60,7 +60,10 @@ active = true; // If we are connected to a poll already, repopulate the screen - if (poll.id != '') return joinPoll({id: poll.id}); + 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"}); // 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 07b7015..dc0dddc 100644 --- a/applications/voting/vote.qml +++ b/applications/voting/vote.qml @@ -648,6 +648,12 @@ Rectangle { } } break; + + // Open the host view + // Only called when the host closes their tablet and reopens it. + case "rehost": + current_page = "poll_host_view" + break; } }