Skip to content

Commit 55c0c40

Browse files
committed
fix(vue): ensure algodClient is a defined computed value
1 parent 141f68c commit 55c0c40

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

examples/vue-ts/src/components/Connect.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const sendTransaction = async (wallet: Wallet) => {
3434
3535
try {
3636
const atc = new algosdk.AtomicTransactionComposer()
37-
const suggestedParams = await algodClient.getTransactionParams().do()
37+
const suggestedParams = await algodClient.value.getTransactionParams().do()
3838
3939
const transaction = algosdk.makePaymentTxnWithSuggestedParamsFromObject({
4040
from: wallet.activeAccount.address,
@@ -47,7 +47,7 @@ const sendTransaction = async (wallet: Wallet) => {
4747
4848
console.info(`[App] Sending transaction...`, transaction)
4949
50-
const result = await atc.execute(algodClient, 4)
50+
const result = await atc.execute(algodClient.value, 4)
5151
5252
console.info(`[App] ✅ Successfully sent transaction!`, {
5353
confirmedRound: result.confirmedRound,

packages/use-wallet-vue/src/useWallet.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,12 @@ export function useWallet() {
112112

113113
return {
114114
wallets,
115-
algodClient,
115+
algodClient: computed(() => {
116+
if (!algodClient.value) {
117+
throw new Error('Algod client is undefined')
118+
}
119+
return algodClient.value
120+
}),
116121
activeNetwork,
117122
activeWallet,
118123
activeWalletAccounts,

0 commit comments

Comments
 (0)