Skip to content

Commit

Permalink
fix: show proposal id and vote tx details in Firefox (#998)
Browse files Browse the repository at this point in the history
This is another case of a Firefox bug due to the difference in how
Firefox and Chrome serialize messages passed between the background and
content scripts. Firefox uses the structured clone algorithm but Chrome
uses JSON serialization.

Fixes #996.
  • Loading branch information
emccorson committed Aug 19, 2024
1 parent 7cf5d7f commit 6442e0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/extension/src/Approvals/Commitment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ const renderContent = (tx: CommitmentDetailProps): ReactNode => {
);

case TxType.VoteProposal:
// TODO: On Chrome, this cast is wrong because tx.proposalId is a string
const voteTx = tx as VoteProposalProps;
return (
<>
Vote {voteTx.vote} on proposal #{voteTx.proposalId}
Vote {voteTx.vote} on proposal #{voteTx.proposalId.toString()}
</>
);

Expand Down
3 changes: 3 additions & 0 deletions apps/extension/src/Approvals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import "@namada/components/src/base.css";
import "../global.css";
import "../tailwind.css";

// Needed to allow displaying tx details containing bigints e.g. proposals
import "@namada/utils/bigint-to-json-polyfill";

const container = document.getElementById("root")!;
createRoot(container).render(
<React.StrictMode>
Expand Down

0 comments on commit 6442e0d

Please sign in to comment.