Skip to content

Commit

Permalink
Merge branch 'main' into 2431-update-contributingmd
Browse files Browse the repository at this point in the history
  • Loading branch information
vacekj authored Oct 15, 2023
2 parents d6bf72b + ba7d589 commit 1bab7b1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export function DonationsTable(props: {
props.contributions.map((chainContribution) => {
const { chainId, data } = chainContribution;
return data.map((contribution) => {
const token = props.tokens[contribution.token];
const tokenId = contribution.token.toLowerCase() + "-" + chainId;
const token = props.tokens[tokenId];

let formattedAmount = "N/A";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ function ViewContributionHistoryFetcher(props: {
return blockies.create({ seed: props.address.toLowerCase() }).toDataURL();
}, [props.address]);

// tokens is a map of token address + chainId to token
const tokens = Object.fromEntries(
votingTokens.map((token) => [token.address, token])
votingTokens.map((token) => [
token.address.toLowerCase() + "-" + token.chainId,
token,
])
);

if (contributionHistory.type === "loading") {
Expand Down Expand Up @@ -105,7 +109,9 @@ export function ViewContributionHistory(props: {
props.contributions.forEach((chainContribution) => {
const { data } = chainContribution;
data.forEach((contribution) => {
const token = props.tokens[contribution.token];
const tokenId =
contribution.token.toLowerCase() + "-" + chainContribution.chainId;
const token = props.tokens[tokenId];
if (token) {
totalDonations += contribution.amountUSD;
totalUniqueContributions += 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const initialQuestionsDirect: SchemaQuestion[] = [
encrypted: false,
hidden: false,
type: "paragraph",
fixed: true,
fixed: false,
},
{
id: 3,
Expand All @@ -99,7 +99,7 @@ export const initialQuestionsDirect: SchemaQuestion[] = [
encrypted: false,
hidden: true,
type: "number",
fixed: true,
fixed: false,
},
{
id: 4,
Expand Down

0 comments on commit 1bab7b1

Please sign in to comment.