Skip to content

Commit 0e018b4

Browse files
authored
Reset currentProposalPubkey when it is removed from the url (#967)
1 parent f595d61 commit 0e018b4

File tree

1 file changed

+13
-3
lines changed
  • governance/xc_admin/packages/xc_admin_frontend/components/tabs

1 file changed

+13
-3
lines changed

governance/xc_admin/packages/xc_admin_frontend/components/tabs/Proposals.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,8 @@ const Proposals = () => {
790790
useEffect(() => {
791791
if (router.query.proposal) {
792792
setCurrentProposalPubkey(router.query.proposal as string)
793+
} else {
794+
setCurrentProposalPubkey(undefined)
793795
}
794796
}, [router.query.proposal])
795797

@@ -828,7 +830,15 @@ const Proposals = () => {
828830
}
829831
}
830832
}
831-
}, [currentProposalPubkey, multisigProposals, cluster])
833+
}, [
834+
switchProposalType,
835+
priceFeedMultisigProposals,
836+
proposalType,
837+
upgradeMultisigProposals,
838+
currentProposalPubkey,
839+
multisigProposals,
840+
cluster,
841+
])
832842

833843
useEffect(() => {
834844
// filter price feed multisig proposals by status
@@ -857,8 +867,8 @@ const Proposals = () => {
857867
<div className="container min-h-[50vh]">
858868
{router.query.proposal === undefined ? (
859869
<>
860-
<div className="flex flex-col md:flex-row justify-between">
861-
<div className="mb-4 md:mb-0 items-center flex">
870+
<div className="flex flex-col justify-between md:flex-row">
871+
<div className="mb-4 flex items-center md:mb-0">
862872
<ClusterSwitch />
863873
</div>
864874
<div className="flex space-x-2">

0 commit comments

Comments
 (0)