nodebb-plugin-poll 2.0.0 → 2.0.3

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/vote.js CHANGED
@@ -69,7 +69,7 @@ const Poll = require('./poll');
69
69
  pollId: pollId,
70
70
  uid: uid,
71
71
  options: options
72
- .filter(option => option.votes.some(_uid => _uid === uid))
72
+ .filter(option => option.votes.some(_uid => parseInt(_uid, 10) === parseInt(uid, 10)))
73
73
  .map(option => option.id),
74
74
  });
75
75
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-poll",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "description": "NodeBB Poll Plugin",
5
5
  "main": "library.js",
6
6
  "scripts": {
package/plugin.json CHANGED
@@ -39,10 +39,8 @@
39
39
  "public/js/poll/creator.js",
40
40
  "public/js/poll/view.js"
41
41
  ],
42
- "acpScripts": [
43
- "public/js/admin.js"
44
- ],
45
42
  "modules": {
43
+ "../admin/plugins/poll.js": "public/js/admin.js",
46
44
  "dayjs.js": "vendor/dayjs.min.js",
47
45
  "flatpickr.js": "vendor/flatpickr.min.js",
48
46
  "flatpickr.i10n.js": "vendor/flatpickr.l10n.js"
@@ -300,7 +300,7 @@
300
300
 
301
301
  View.prototype.showResultsPanel = function () {
302
302
  this.hideVotingPanel();
303
- if (this.voteUpdateAllowed() && !this.hasPollEndedOrDeleted()) {
303
+ if ((!this.pollData.hasVoted || this.voteUpdateAllowed()) && !this.hasPollEndedOrDeleted()) {
304
304
  this.showVotingPanelButton();
305
305
  } else {
306
306
  this.hideVotingPanelButton();