From ea60d44579428017d386f507ec970be2e0bd0a58 Mon Sep 17 00:00:00 2001 From: Bob Date: Mon, 16 Dec 2024 12:38:19 +0100 Subject: [PATCH] Add loading state --- client/src/ui/components/resources/realm-transfer.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/ui/components/resources/realm-transfer.tsx b/client/src/ui/components/resources/realm-transfer.tsx index d60950660..a981db3a4 100644 --- a/client/src/ui/components/resources/realm-transfer.tsx +++ b/client/src/ui/components/resources/realm-transfer.tsx @@ -37,6 +37,7 @@ export const RealmTransfer = memo( const { playerStructures } = useEntities(); + const [isLoading, setIsLoading] = useState(false); const [calls, setCalls] = useState([]); const [type, setType] = useState<"send" | "receive">("send"); @@ -64,7 +65,7 @@ export const RealmTransfer = memo( }, [calls]); const handleTransfer = useCallback(() => { - // setIsLoading(true); + setIsLoading(true); const cleanedCalls = calls.map(({ sender_entity_id, recipient_entity_id, resources }) => ({ sender_entity_id, recipient_entity_id, @@ -76,7 +77,7 @@ export const RealmTransfer = memo( calls: cleanedCalls, }).finally(() => { // playDonkeyScreaming(); - // setIsLoading(false); + setIsLoading(false); }); }, [calls]); @@ -143,7 +144,7 @@ export const RealmTransfer = memo(
-