Skip to content

Commit

Permalink
fix hanging confirmation drawer on xnft uninstall (#3614)
Browse files Browse the repository at this point in the history
  • Loading branch information
callensm authored Apr 5, 2023
1 parent c184e9d commit 40f5bd6
Showing 1 changed file with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
} from "@coral-xyz/react-common";
import {
useBackgroundClient,
useNavigation,
useSolanaConnectionUrl,
useSolanaCtx,
useSolanaExplorer,
Expand All @@ -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";
Expand Down Expand Up @@ -253,6 +251,7 @@ const UninstallConfirmationCard = ({ xnft }: { xnft: any }) => {
"confirm" | "sending" | "complete" | "error"
>("confirm");
const [txSignature, setTxSignature] = useState<string | null>(null);

const onConfirm = async () => {
//
// Change view to display loading indicator.
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -362,8 +363,6 @@ function Sending({
const theme = useCustomTheme();
const solanaExplorer = useSolanaExplorer();
const connectionUrl = useSolanaConnectionUrl();
const nav = useNavigation();
const drawer = useDrawerContext();
return (
<div
style={{
Expand Down Expand Up @@ -417,16 +416,9 @@ function Sending({
>
<SecondaryButton
onClick={() => {
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"
/>
</div>
</div>
Expand Down

1 comment on commit 40f5bd6

@vercel
Copy link

@vercel vercel bot commented on 40f5bd6 Apr 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.