From 40f5bd69f3df8216f94cfbf531d1a394541f5609 Mon Sep 17 00:00:00 2001 From: Matthew Callens Date: Wed, 5 Apr 2023 12:55:57 -0400 Subject: [PATCH] fix hanging confirmation drawer on xnft uninstall (#3614) --- .../Unlocked/Settings/Xnfts/Detail.tsx | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/packages/app-extension/src/components/Unlocked/Settings/Xnfts/Detail.tsx b/packages/app-extension/src/components/Unlocked/Settings/Xnfts/Detail.tsx index a97739c42..49e47d8f0 100644 --- a/packages/app-extension/src/components/Unlocked/Settings/Xnfts/Detail.tsx +++ b/packages/app-extension/src/components/Unlocked/Settings/Xnfts/Detail.tsx @@ -19,7 +19,6 @@ import { } from "@coral-xyz/react-common"; import { useBackgroundClient, - useNavigation, useSolanaConnectionUrl, useSolanaCtx, useSolanaExplorer, @@ -32,7 +31,6 @@ import { useRecoilValue } from "recoil"; import { updateRemotePreference } from "../../../../api/preferences"; import { ApproveTransactionDrawer } from "../../../common/ApproveTransactionDrawer"; -import { useDrawerContext } from "../../../common/Layout/Drawer"; import { useNavigation as useNavigationEphemeral } from "../../../common/Layout/NavStack"; import { SettingsList } from "../../../common/Settings/List"; import { Error } from "../../Balances/TokensWidget/Send"; @@ -253,6 +251,7 @@ const UninstallConfirmationCard = ({ xnft }: { xnft: any }) => { "confirm" | "sending" | "complete" | "error" >("confirm"); const [txSignature, setTxSignature] = useState(null); + const onConfirm = async () => { // // Change view to display loading indicator. @@ -285,6 +284,8 @@ const UninstallConfirmationCard = ({ xnft }: { xnft: any }) => { ? "confirmed" : ctx.commitment ); + + setCardType("complete"); } catch (err: any) { logger.error("unable to confirm", err); setError(err.toString()); @@ -362,8 +363,6 @@ function Sending({ const theme = useCustomTheme(); const solanaExplorer = useSolanaExplorer(); const connectionUrl = useSolanaConnectionUrl(); - const nav = useNavigation(); - const drawer = useDrawerContext(); return (
{ - if (isComplete) { - nav.toRoot(); - drawer.close(); - } else { - window.open( - explorerUrl(solanaExplorer, signature, connectionUrl) - ); - } + window.open(explorerUrl(solanaExplorer, signature, connectionUrl)); }} - label={isComplete ? "View Balances" : "View Explorer"} + label="View Explorer" />