Reset currentProposalPubkey when it is removed from the url (#967)
This commit is contained in:
parent
f595d61ccd
commit
0e018b44c1
|
@ -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">
|
||||||
|
|
Loading…
Reference in New Issue