mirror of
https://github.com/overte-org/community-apps.git
synced 2025-08-08 16:58:22 +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
|
// Cast a vote on a poll
|
||||||
function castVote(event) {
|
function castVote(event) {
|
||||||
console.log(`Casting vote to ${poll.id}: ${event}`);
|
console.log(`Casting vote to ${poll.id}`);
|
||||||
|
|
||||||
// Check if poll is valid
|
// Check if poll is valid
|
||||||
if (poll == undefined || poll.id == '') return;
|
if (poll == undefined || poll.id == '') return;
|
||||||
|
|
||||||
// Send vote to server
|
// Send vote to users in poll
|
||||||
Messages.sendMessage(poll.id, JSON.stringify({type: "vote", option: event.option}));
|
Messages.sendMessage(poll.id, JSON.stringify({type: "vote", ballot: event.ballot, uuid: myUuid}));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit the prompt question and options to the server
|
// Emit the prompt question and options to the server
|
||||||
|
@ -192,8 +192,7 @@
|
||||||
// Communication
|
// Communication
|
||||||
function fromQML(event) {
|
function fromQML(event) {
|
||||||
console.log(`New QML event:\n${JSON.stringify(event)}`);
|
console.log(`New QML event:\n${JSON.stringify(event)}`);
|
||||||
// event = JSON.parse(event);
|
|
||||||
console.log(event.type);
|
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case "create_poll":
|
case "create_poll":
|
||||||
createPoll(event.poll);
|
createPoll(event.poll);
|
||||||
|
|
|
@ -365,6 +365,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Keep track of used numbers and blacklist them
|
||||||
// Options
|
// Options
|
||||||
Item {
|
Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
Loading…
Reference in a new issue