From 5e222d69f3503a0fb351a5d0876c13a6c0a26ec8 Mon Sep 17 00:00:00 2001 From: noumantahir Date: Mon, 11 Nov 2024 16:27:26 +0500 Subject: [PATCH] close modal on transaction complete --- .../hiveAuthModal/container/hiveAuthModal.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/hiveAuthModal/container/hiveAuthModal.tsx b/src/components/hiveAuthModal/container/hiveAuthModal.tsx index 57fb665b1..540e90748 100644 --- a/src/components/hiveAuthModal/container/hiveAuthModal.tsx +++ b/src/components/hiveAuthModal/container/hiveAuthModal.tsx @@ -13,6 +13,7 @@ import { ModalHeader } from '../..'; import { AuthInputContent } from '../children/authInputContent'; import { StatusContent } from '../children/statusContent'; import { HiveAuthStatus, useHiveAuth } from '../hooks/useHiveAuth'; +import { Operation } from '@hiveio/dhive'; interface HiveAuthModalProps { onClose?: () => void; @@ -37,7 +38,8 @@ export const HiveAuthModal = forwardRef(({ onClose }: HiveAuthModalProps, ref) = broadcastActiveOps: (opsArray: any) => { if (opsArray) { bottomSheetModalRef.current?.show(); - hiveAuth.broadcast(opsArray); + handleBroadcastRequst(opsArray); + } }, })); @@ -62,6 +64,13 @@ export const HiveAuthModal = forwardRef(({ onClose }: HiveAuthModalProps, ref) = } }; + const handleBroadcastRequst = async (opsArray:Operation[]) => { + const success = await hiveAuth.broadcast(opsArray); + if(success){ + _closeModal(); + } + } + const _closeModal = () => { bottomSheetModalRef.current?.hide(); if (onClose) {