diff --git a/package.json b/package.json index 1b0aad5..e073195 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ghost-dao-interface", "private": true, - "version": "0.5.17", + "version": "0.5.18", "type": "module", "scripts": { "dev": "vite", diff --git a/src/containers/Governance/NewProposal.jsx b/src/containers/Governance/NewProposal.jsx index e44b4e9..0ee02e2 100644 --- a/src/containers/Governance/NewProposal.jsx +++ b/src/containers/Governance/NewProposal.jsx @@ -33,7 +33,7 @@ import { DecimalBigNumber } from "../../helpers/DecimalBigNumber"; import ProposalModal from "./components/ProposalModal"; import { parseFunctionCalldata } from "./components/functions/index"; -import { MY_PROPOSALS_PREFIX, VOTED_PROPOSALS_PREFIX } from "./helpers"; +import { MY_PROPOSALS_PREFIX } from "./helpers"; const NewProposal = ({ config, address, connect, chainId }) => { const isSemiSmallScreen = useMediaQuery("(max-width: 745px)"); diff --git a/src/containers/Governance/ProposalDetails.jsx b/src/containers/Governance/ProposalDetails.jsx index d2b766f..720242f 100644 --- a/src/containers/Governance/ProposalDetails.jsx +++ b/src/containers/Governance/ProposalDetails.jsx @@ -28,7 +28,7 @@ import { PrimaryButton, SecondaryButton } from "../../components/Button"; import GhostStyledIcon from "../../components/Icon/GhostIcon"; import ArrowUpIcon from "../../assets/icons/arrow-up.svg?react"; -import { formatNumber, shorten } from "../../helpers"; +import { formatNumber, formatCurrency, shorten } from "../../helpers"; import { prettifySecondsInDays } from "../../helpers/timeUtil"; import { DecimalBigNumber, } from "../../helpers/DecimalBigNumber"; @@ -36,7 +36,7 @@ import { convertStatusToTemplate, convertStatusToLabel } from "./helpers"; import { parseFunctionCalldata } from "./components/functions"; import { networkAvgBlockSpeed } from "../../constants"; -import { formatCurrency } from "../../helpers"; + import { useTokenSymbol, usePastTotalSupply, usePastVotes, useBalance } from "../../hooks/tokens"; import { useProposalState, @@ -54,6 +54,8 @@ import { releaseLocked } from "../../hooks/governance"; +import { VOTED_PROPOSALS_PREFIX } from "./helpers"; + /////////////////////////////////////////////////////// import Timeline from '@mui/lab/Timeline'; import TimelineItem from '@mui/lab/TimelineItem'; @@ -156,7 +158,13 @@ const ProposalDetails = ({ chainId, address, connect, config }) => { const handleVote = async (against) => { setIsPending(true); const support = against ? 0 : 1; - await castVote(chainId, address, proposalId, support); + const result = await castVote(chainId, address, proposalId, support); + + if (result) { + const toStore = JSON.stringify(proposalId.toString())); + localStorage.setItem(VOTED_PROPOSALS_PREFIX, toStore); + } + setIsPending(true); }