diff --git a/applications/voting/vote.js b/applications/voting/vote.js index 8be0b43..575f417 100644 --- a/applications/voting/vote.js +++ b/applications/voting/vote.js @@ -80,10 +80,10 @@ // If we are connected to a poll already, repopulate the screen 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: "switch_page", page: selectedPage, poll: poll, pollStats: pollStats}); - } + // Sync + // TODO: switch_page optional sync components? + _emitEvent({type: "poll_sync", poll: poll, pollStats: pollStats, isHost: poll.host == myUuid}); + if (selectedPage) _emitEvent({type: "switch_page", page: selectedPage, poll: poll, pollStats: pollStats}); // 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 9fb053e..78aa436 100644 --- a/applications/voting/vote.qml +++ b/applications/voting/vote.qml @@ -1019,6 +1019,8 @@ Rectangle { case "poll_sync": poll = message.poll; pollStats = message.pollStats; + is_host = message.isHost; + canHostVote = message.poll.canHostVote; break; } }