-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Unlock feature #46
base: dev
Are you sure you want to change the base?
Conversation
Made a dynamic dropdown; Moved vote option creation to PollHelpers Prevent button press processing when vote is locked; Changed how "isLocked" status is determined; Add notification to user if their vote was blocked due to it being locked. Remove empty votes from results; Remove null from section, because null causes errors when sending the message.
@@ -123,6 +131,16 @@ export class Actions { | |||
} | |||
} | |||
|
|||
private onUnlockSelected(payload: any, poll: Poll): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
this.isLocked = true; | ||
this.generateVoteResults(); | ||
this.message = this.message.slice(0, 2).concat(this.message.slice(this.getDividerId() - 1)); | ||
this.message = this.message.slice(0, this.getDividerId() - 1).concat(this.getDynamicSelect()).concat(this.message.slice(this.getDividerId())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
|
||
public unlockpoll(): void { | ||
this.isLocked = false; | ||
this.message = this.message.slice(0, this.getDividerId() - 1).concat(this.getDynamicSelect()).concat({type: "divider"}).concat(this.message.slice(this.getDividerId() + 2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
Code Climate has analyzed commit b28ae50 and detected 4 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Added Unlock feature;
Made a dynamic dropdown;
Moved vote option creation to PollHelpers
Prevent button press processing when vote is locked;
Changed how "isLocked" status is determined;
Add notification to user if their vote was blocked due to it being locked.
Remove empty votes from results;
Remove null from section, because null causes errors when sending the message;
Ran ESlint;