nodebb-plugin-poll 4.0.3 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/sockets.js CHANGED
@@ -32,11 +32,11 @@ Sockets.get = async function (socket, data) {
32
32
  return null;
33
33
  }
34
34
 
35
- if (parseInt(pollData.allowAnonVoting, 10) === 1) {
35
+ if (parseInt(pollData.info.allowAnonVoting, 10) === 1) {
36
36
  await anonymizeVoters(socket.uid, pollId, pollData.options);
37
37
  }
38
38
 
39
- pollData.optionType = parseInt(pollData.maximumVotesPerUser, 10) > 1 ? 'checkbox' : 'radio';
39
+ pollData.optionType = parseInt(pollData.info.maximumVotesPerUser, 10) > 1 ? 'checkbox' : 'radio';
40
40
  return pollData;
41
41
  }));
42
42
  };
package/lib/vote.js CHANGED
@@ -79,7 +79,7 @@ Vote.canUpdateVote = async function (uid, pollId) {
79
79
  Poll.isDeleted(pollId),
80
80
  Poll.doesDisallowVoteUpdate(pollId),
81
81
  ]);
82
- return !canRead && !ended && !deleted && !updateDisabled;
82
+ return canRead && !ended && !deleted && !updateDisabled;
83
83
  };
84
84
 
85
85
  Vote.canVote = async function (uid, pollId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-poll",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "NodeBB Poll Plugin",
5
5
  "main": "library.js",
6
6
  "scripts": {
package/plugin.json CHANGED
@@ -34,8 +34,7 @@
34
34
  "public/js/poll/view.js"
35
35
  ],
36
36
  "modules": {
37
- "../admin/plugins/poll.js": "public/js/admin.js",
38
- "poll/serializer.js": "public/js/poll/serializer.js"
37
+ "../admin/plugins/poll.js": "public/js/admin.js"
39
38
  },
40
39
  "templates": "templates",
41
40
  "languages": "languages",