From 8018d114e6d15a0df89b324f10235b5fb6b2b6fa Mon Sep 17 00:00:00 2001 From: Starknet Dev Date: Mon, 7 Oct 2024 21:21:32 +0100 Subject: [PATCH] - set input to current adventurer name by default - don't get balances on katana --- ui/src/app/components/start/AdventurerListCard.tsx | 7 ++++++- ui/src/app/lib/utils/syscalls.ts | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ui/src/app/components/start/AdventurerListCard.tsx b/ui/src/app/components/start/AdventurerListCard.tsx index 4dc97f520..23d7ef212 100644 --- a/ui/src/app/components/start/AdventurerListCard.tsx +++ b/ui/src/app/components/start/AdventurerListCard.tsx @@ -66,7 +66,12 @@ export const AdventurerListCard = ({ >(null); const [isEditOpen, setIsEditOpen] = useState(false); - const [adventurerName, setAdventurerName] = useState(""); + const [adventurerName, setAdventurerName] = useState(adventurer?.name || ""); + + useEffect(() => { + setAdventurerName(adventurer?.name!); + }, [adventurer]); + const [isMaxLength, setIsMaxLength] = useState(false); const setAdventurer = useAdventurerStore((state) => state.setAdventurer); diff --git a/ui/src/app/lib/utils/syscalls.ts b/ui/src/app/lib/utils/syscalls.ts index 4d3680380..9aa827183 100644 --- a/ui/src/app/lib/utils/syscalls.ts +++ b/ui/src/app/lib/utils/syscalls.ts @@ -1497,7 +1497,7 @@ export function createSyscalls({ } setIsMintingLords(false); - getBalances(); + !onKatana && getBalances(); } catch (e) { setIsMintingLords(false); console.log(e); @@ -1611,7 +1611,7 @@ export function createSyscalls({ adventurers: [adventurer], }); - getBalances(); + !onKatana && getBalances(); stopLoading("Transferred Adventurer", false, "Transfer"); } catch (error) { console.error(error); @@ -1681,7 +1681,7 @@ export function createSyscalls({ ], }); - getBalances(); + !onKatana && getBalances(); stopLoading("Changed Adventurer Name", false, "Change Name"); } } catch (error) {