Skip to content

Commit

Permalink
[#257 #374] Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JanJaroszczak committed Mar 27, 2024
1 parent 66d36fb commit 315731e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const DashboardGovernanceActionDetails = () => {
state ? state.txHash : data?.proposal.txHash ?? "",
state ? state.index : data?.proposal.index ?? "",
);
const title = state ? state.title : data.proposal.title;
const title = state ? state.title : data?.proposal.title;

return (
<Box
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/pages/GovernanceActionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const GovernanceActionDetails = () => {
state ? state.txHash : data?.proposal.txHash ?? "",
state ? state.index : data?.proposal.index ?? "",
);
const title = state ? state.title : data.proposal.title;
const title = state ? state.title : data?.proposal.title;

useEffect(() => {
if (isEnabled && getItemFromLocalStorage(`${WALLET_LS_KEY}_stake_key`)) {
Expand Down
33 changes: 30 additions & 3 deletions govtool/frontend/src/utils/tests/removeDuplicatedProposals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,72 @@ const uniqueProposals = [
txHash: "2bca7756ba6c998518c1bccbcdd5165e32d3c8e0bfdf930d34359c98354e85a0",
index: 0,
type: "InfoAction",
details: "InfoAction 1",
details: {
description: "Info about InfoAction 1",
additionalInfo: "Additional information for InfoAction 1",
},
expiryDate: "2024-01-08T15:32:13.61165Z",
expiryEpochNo: 1673183533,
createdDate: "2023-12-29T23:04:41Z",
createdEpochNo: 1672350281,
url: "https://bit.ly/3zCH2HL",
metadataHash:
"1111111111111111111111111111111111111111111111111111111111111111",
yesVotes: 0,
noVotes: 0,
abstainVotes: 81528377728,
title: "Proposal 1322 Title",
about: "This is about Proposal 1322",
motivation: "Motivation behind Proposal 1322",
rationale: "Rationale for Proposal 1322",
},
{
id: "1338",
txHash: "5e37f4d48182c4d8ff8e8ee7472c066501459b7bc8aaf6ca2f93a522ae12b0ea",
index: 0,
type: "InfoAction",
details: "InfoAction 2",
details: {
description: "Info about InfoAction 2",
additionalInfo: "Additional information for InfoAction 2",
},
expiryDate: "2024-01-15T15:16:04.8932Z",
expiryEpochNo: 1673895364,
createdDate: "2024-01-05T23:06:02Z",
createdEpochNo: 1672953962,
url: "https://bit.ly/3zCH2HL",
metadataHash:
"2222222222222222222222222222222222222222222222222222222222222222",
yesVotes: 0,
noVotes: 0,
abstainVotes: 81528377728,
title: "Proposal 1338 Title",
about: "This is about Proposal 1338",
motivation: "Motivation behind Proposal 1338",
rationale: "Rationale for Proposal 1338",
},
{
id: "1335",
txHash: "e88ddff921de8b7f6079a1c25a301c034de6b3ec8a906ad75463f0f5b3597672",
index: 0,
type: "InfoAction",
details: "InfoAction 3",
details: {
description: "Info about InfoAction 3",
additionalInfo: "Additional information for InfoAction 3",
},
expiryDate: "2024-01-14T15:18:23.28155Z",
expiryEpochNo: 1673807903,
createdDate: "2024-01-04T23:06:36Z",
createdEpochNo: 1672867596,
url: "https://bit.ly/3zCH2HL",
metadataHash:
"3333333333333333333333333333333333333333333333333333333333333333",
yesVotes: 3175400714,
noVotes: 0,
abstainVotes: 81528377728,
title: "Proposal 1335 Title",
about: "This is about Proposal 1335",
motivation: "Motivation behind Proposal 1335",
rationale: "Rationale for Proposal 1335",
},
];

Expand Down

0 comments on commit 315731e

Please sign in to comment.