mirror of
https://github.com/AleziaKurdis/Overte-community-apps.git
synced 2025-04-05 13:37:41 +02:00
Prompt before closing poll.
This commit is contained in:
parent
8b4df95790
commit
e117c13515
2 changed files with 5 additions and 3 deletions
|
@ -15,7 +15,6 @@
|
|||
// TODO: Allow host voting
|
||||
// TODO: Sound for new vote
|
||||
// TODO: Clear poll host view on creating new poll
|
||||
// TODO: Confirm before closing poll
|
||||
// TODO: Debug mode?
|
||||
// FIXME: Handle ties
|
||||
// FIXME: Joining poll resets everyones vote
|
||||
|
@ -139,13 +138,17 @@
|
|||
// We are in a poll
|
||||
if (poll.id == '') return;
|
||||
|
||||
var answer = Window.confirm('Are you sure you want to close the poll?')
|
||||
|
||||
if (!answer) return;
|
||||
|
||||
console.log("Closing active poll");
|
||||
|
||||
// Submit the termination message to all clients
|
||||
Messages.sendMessage("ga-polls", JSON.stringify({type: "close_poll", poll: {id: poll.id}}));
|
||||
|
||||
// Update the UI screen
|
||||
_emitEvent({type: "close_poll", poll: {id: poll.id}});
|
||||
_emitEvent({type: "close_poll", poll: {id: poll.id}, change_page: true});
|
||||
|
||||
// Clear our active poll data
|
||||
poll = { host: '', title: '', description: '', id: '', question: '', options: []};
|
||||
|
|
|
@ -266,7 +266,6 @@ Rectangle {
|
|||
anchors.fill: parent
|
||||
onClicked: {
|
||||
toScript({type: "close_poll"});
|
||||
current_page = "poll_list";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue