Skip to content

Commit

Permalink
Refactored signArbWallet initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntNerve committed Feb 22, 2024
1 parent 887eff6 commit 7557146
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/abstraxion/src/hooks/useAbstraxionSigningClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ export const useAbstraxionSigningClient = (): {
}
return wallet;
};
useEffect(() => {
(async () => {
const wallet = await getTempAccount();
if (wallet) {
setSignArbWallet(wallet);
}
})();
}, []);

const [abstractClient, setAbstractClient] = useState<
GranteeSignerClient | undefined
Expand Down Expand Up @@ -70,6 +62,11 @@ export const useAbstraxionSigningClient = (): {
},
);

const wallet = await getTempAccount();
if (wallet) {
setSignArbWallet(wallet);
}

setAbstractClient(directClient);
} catch (error) {
console.log("Something went wrong: ", error);
Expand Down

0 comments on commit 7557146

Please sign in to comment.