mirror of
https://github.com/overte-org/community-apps.git
synced 2025-04-07 09:42:08 +02:00
Creating and sending ballot
This commit is contained in:
parent
f62d20908a
commit
efc64c6cd7
2 changed files with 5 additions and 5 deletions
|
@ -164,13 +164,13 @@
|
|||
|
||||
// Cast a vote on a poll
|
||||
function castVote(event) {
|
||||
console.log(`Casting vote to ${poll.id}: ${event}`);
|
||||
console.log(`Casting vote to ${poll.id}`);
|
||||
|
||||
// Check if poll is valid
|
||||
if (poll == undefined || poll.id == '') return;
|
||||
|
||||
// Send vote to server
|
||||
Messages.sendMessage(poll.id, JSON.stringify({type: "vote", option: event.option}));
|
||||
// Send vote to users in poll
|
||||
Messages.sendMessage(poll.id, JSON.stringify({type: "vote", ballot: event.ballot, uuid: myUuid}));
|
||||
}
|
||||
|
||||
// Emit the prompt question and options to the server
|
||||
|
@ -192,8 +192,7 @@
|
|||
// Communication
|
||||
function fromQML(event) {
|
||||
console.log(`New QML event:\n${JSON.stringify(event)}`);
|
||||
// event = JSON.parse(event);
|
||||
console.log(event.type);
|
||||
|
||||
switch (event.type) {
|
||||
case "create_poll":
|
||||
createPoll(event.poll);
|
||||
|
|
|
@ -365,6 +365,7 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: Keep track of used numbers and blacklist them
|
||||
// Options
|
||||
Item {
|
||||
width: parent.width
|
||||
|
|
Loading…
Reference in a new issue