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: update gatekeeper, ballot callbacks and fix images for ballots #308

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading