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

refresh vote data after user submits vote #139

Open
jigglyjams opened this issue Jul 3, 2024 · 1 comment
Open

refresh vote data after user submits vote #139

jigglyjams opened this issue Jul 3, 2024 · 1 comment
Assignees

Comments

@jigglyjams
Copy link
Contributor

refetch the vote data so all the percentages and quorum is proper after the user submits their vote

@jigglyjams jigglyjams converted this from a draft issue Jul 3, 2024
@twodam
Copy link
Collaborator

twodam commented Jul 23, 2024

it can refetch vote list

// shorthand functions
const submitVote = () => {
//setNotificationEnabled(true);
trigger().then(close).then(refetch);
};
const { loading, data, error, refetch } = useProposalVotes(
proposalInfo,
Math.max((query.page - 1) * VOTES_PER_PAGE, 0),
query.sortBy as "created" | "vp",
query.withField as "reason" | "app" | "",
);

oh, I think the VotesBar is using data from proposalInfo which didn't refetch upon new vote. I should find a way to trigger refetch in

const {
data: { proposalsData },
} = useProposalsByID([proposalHash], "", proposalHash === undefined);

@twodam twodam moved this from Todo to In Progress in nance-1.0 Jul 23, 2024
@twodam twodam self-assigned this Jul 23, 2024
@twodam twodam moved this from In Progress to Done in nance-1.0 Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants