Skip to content

Commit

Permalink
Fix polls
Browse files Browse the repository at this point in the history
  • Loading branch information
PurpleHorrorRus committed Oct 17, 2022
1 parent 6312c8c commit f40cc7a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/renderer/instances/Messages/Attachments/Poll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ class Poll extends Attachment implements IPreview {
}

vote(answer: TPollChoice): boolean {
if (this.choice(answer)) {
this.choice(answer);

if (!this.multiple) {
this.votes++;
this._can_vote = false;
return true;
Expand Down Expand Up @@ -105,10 +107,12 @@ class Poll extends Attachment implements IPreview {
},

foreground: {
background: `linear-gradient(
background: this._background
? `linear-gradient(
transparent -100%,
#${this._background.color} 100%
)`
: "var(--backdrop)"
}
};
}
Expand All @@ -117,11 +121,13 @@ class Poll extends Attachment implements IPreview {
poll: {},

foreground: {
background: `linear-gradient(
background: this._background
? `linear-gradient(
${this._background.angle}deg,
#${this._background.points[0].color} 0%,
#${this._background.points[1].color} 100%
)`
: "var(--backdrop)"
}
};
}
Expand Down

0 comments on commit f40cc7a

Please sign in to comment.