Skip to content

Commit

Permalink
Merge pull request #308 from privacy-scaling-explorations/fix/ballot-…
Browse files Browse the repository at this point in the history
…and-free-for-all

fix: update gatekeeper, ballot callbacks and fix images for ballots
  • Loading branch information
ctrlc03 authored Sep 6, 2024
2 parents 0ad1e4b + 249cabf commit bf37764
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/interface/src/contexts/Ballot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const BallotProvider: React.FC<BallotProviderProps> = ({ children }: Ball
const amount = !Number.isNaN(Number(x.amount)) ? Number(x.amount) : 0;
return sum + (pollData && pollData.mode.toString() === "0" ? amount ** 2 : amount);
}, 0),
[],
[pollData],
);

const ballotContains = useCallback((id: string) => ballot.votes.find((v) => v.projectId === id), [ballot]);
Expand Down
5 changes: 4 additions & 1 deletion packages/interface/src/contexts/Maci.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export const MaciProvider: React.FC<MaciProviderProps> = ({ children }: MaciProv
});
setIsLoading(false);
break;
case GatekeeperTrait.FreeForAll:
setIsLoading(false);
break;
default:
break;
}
Expand All @@ -159,7 +162,7 @@ export const MaciProvider: React.FC<MaciProviderProps> = ({ children }: MaciProv
// for instance with semaphore
const isEligibleToVote = useMemo(
() => gatekeeperTrait && (gatekeeperTrait === GatekeeperTrait.FreeForAll || Boolean(sgData)) && Boolean(address),
[sgData, address],
[sgData, address, gatekeeperTrait],
);

// on load get the key pair from local storage and set the signature message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const ProjectAvatarWithName = ({

return (
<Component className="flex flex-1 items-center gap-4" href={`/projects/${id}`} tabIndex={-1}>
<ProjectAvatar profileId={projects?.[0]?.recipient} rounded="full" size="sm" />
<ProjectAvatar rounded="full" size="sm" url={metadata.data?.bannerImageUrl} />

<div>
<div className="font-bold uppercase">{projects?.[0]?.name}</div>
Expand Down

0 comments on commit bf37764

Please sign in to comment.