Reset currentProposalPubkey when it is removed from the url (#967)

This commit is contained in:
Mohammad Amin Khashkhashi Moghaddam 2023-07-20 13:06:49 +02:00 committed by GitHub
parent f595d61ccd
commit 0e018b44c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -790,6 +790,8 @@ const Proposals = () => {
useEffect(() => { useEffect(() => {
if (router.query.proposal) { if (router.query.proposal) {
setCurrentProposalPubkey(router.query.proposal as string) setCurrentProposalPubkey(router.query.proposal as string)
} else {
setCurrentProposalPubkey(undefined)
} }
}, [router.query.proposal]) }, [router.query.proposal])
@ -828,7 +830,15 @@ const Proposals = () => {
} }
} }
} }
}, [currentProposalPubkey, multisigProposals, cluster]) }, [
switchProposalType,
priceFeedMultisigProposals,
proposalType,
upgradeMultisigProposals,
currentProposalPubkey,
multisigProposals,
cluster,
])
useEffect(() => { useEffect(() => {
// filter price feed multisig proposals by status // filter price feed multisig proposals by status
@ -857,8 +867,8 @@ const Proposals = () => {
<div className="container min-h-[50vh]"> <div className="container min-h-[50vh]">
{router.query.proposal === undefined ? ( {router.query.proposal === undefined ? (
<> <>
<div className="flex flex-col md:flex-row justify-between"> <div className="flex flex-col justify-between md:flex-row">
<div className="mb-4 md:mb-0 items-center flex"> <div className="mb-4 flex items-center md:mb-0">
<ClusterSwitch /> <ClusterSwitch />
</div> </div>
<div className="flex space-x-2"> <div className="flex space-x-2">