Skip to content
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

Incorrect revision link when candidate withdraws #148

Closed
samliew opened this issue Oct 27, 2021 · 1 comment
Closed

Incorrect revision link when candidate withdraws #148

samliew opened this issue Oct 27, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@samliew
Copy link
Owner

samliew commented Oct 27, 2021

See https://chat.stackexchange.com/messages/59451396/history

@Oaphi
Copy link
Collaborator

Oaphi commented Nov 12, 2021

Reworked nominationLink getter to not rely on replace and just use the information made available by the Election class:

get nominationLink() {
const { _nominationLink, hasWithdrawn, election } = this;
const postId = matchNumber(/#post-(\d+)/, _nominationLink);
// If withdrawn, change to post history as original post can longer be viewed
return hasWithdrawn ? `${election.siteUrl}/posts/${postId}/revisions` : _nominationLink;
}

Combined with the previous changes that add a nominee to the list only once (using Map indexed on userId), the issue is impossible to encounter now.

@Oaphi Oaphi closed this as completed Nov 12, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants