From 7a89e2a1738f3eb89adec1399c74d79d12c7d023 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Jun 2025 17:48:42 +0700 Subject: [PATCH] token n legacy --- src/pages/members/agent-balance/AgentBalance.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/members/agent-balance/AgentBalance.tsx b/src/pages/members/agent-balance/AgentBalance.tsx index f5b79ec..2bdc376 100644 --- a/src/pages/members/agent-balance/AgentBalance.tsx +++ b/src/pages/members/agent-balance/AgentBalance.tsx @@ -108,6 +108,7 @@ const AgentBalance = () => { const handleReload = async () => { setIsReloading(true); await fetchAgentBalance(currentPage, pageSize, '',''); + closeDialog() setIsReloading(false); // fetchAgentBalance(); }; @@ -192,6 +193,7 @@ const AgentBalance = () => { setToken_legacy={setToken_legacy} customerId={formData.id} agent_name={formData.agent_name} + handleReload={handleReload} /> @@ -202,7 +204,7 @@ const AgentBalance = () => { }; // ==================== -const PaymentCard = ({ barcode, agent_name, customerId, token_legacy, setToken_legacy }: any) => { +const PaymentCard = ({ barcode, agent_name, customerId, token_legacy, setToken_legacy, handleReload }: any) => { const cardRef: any = useRef(null); const waitForImageLoad = (img: HTMLImageElement): Promise => { @@ -248,6 +250,7 @@ const PaymentCard = ({ barcode, agent_name, customerId, token_legacy, setToken_l token_legacy }); toast.success(`Success Update Token Legacy`); + await handleReload(); } catch (error: any) { let err_msg = error?.response?.data?.error || error.message toast.error(err_msg);