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

fix: Proposal diff bugs #2639

Merged
merged 2 commits into from
Oct 21, 2021
Merged

Conversation

vibros68
Copy link
Contributor

closes #2583

This diff fixes some bugs on proposal diff version.

  • Fix: after clicking on version button, duplicate request are sent to
    the server.
  • Fix: Hide the version button when the proposal is cencered or when
    the proposal is unvetted and the user is not admin or author.
  • Fix: Title text is overlap in the mobile screen.
    Screenshot from 2021-10-20 21-03-47

@vibros68
Copy link
Contributor Author

@lukebp ready for review

Copy link
Member

@lukebp lukebp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK on Firefox.

  • Duplicate request has been removed.
  • Diff viewer is not shown on unvetted or vetted censored proposals.
  • Diff viewer is shown on unvetted for admins.
  • Diff viewer is not shown on unvetted proposals non-logged in users.

@lukebp
Copy link
Member

lukebp commented Oct 20, 2021

Needs code approval from @tiagoalvesdulce.

Copy link
Member

@tiagoalvesdulce tiagoalvesdulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

Copy link
Member

@victorgcramos victorgcramos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really nice! Thanks for the PR @vibros68!

Comment on lines +54 to +87
const [state, send] = useFetchMachine({
actions: {
initial: () => {
if (versionsQueue.length) {
return send(START);
}
return send(RESOLVE);
},
start: () => {
if (!versionsQueue.length) {
return send(RESOLVE);
}
const version = versionsQueue[0];
if (version <= 0) {
setVersionsQueue(drop(versionsQueue));
return send(START);
}
onFetchProposalDetailsWithoutState(token, version)
.then((proposal) => {
setFetchedProposals({
...fetchedProposals,
[version]: proposal
});
setVersionsQueue(drop(versionsQueue));
if (setVersionsQueue.length) {
return send(START);
}
return send(RESOLVE);
})
.catch((e) => send(REJECT, e));

return send(FETCH);
},
done: () => {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AWESOME! Good job here, mate!

@lukebp lukebp merged commit a75198c into decred:master Oct 21, 2021
@vibros68 vibros68 mentioned this pull request Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal diff bugs.
4 participants