diff --git a/components/CounterButton.tsx b/components/CounterButton.tsx index 4d5ac6a..deecbf4 100644 --- a/components/CounterButton.tsx +++ b/components/CounterButton.tsx @@ -59,7 +59,7 @@ const authResult = await authorizeSession(wallet); const latestBlockhashResult = await connection.getLatestBlockhash(); - const ix = await program.methods + const instruction = await program.methods .increment() .accounts({ counter: counterAddress, user: authResult.publicKey }) .instruction(); @@ -83,16 +83,16 @@ const transaction = new Transaction({ ...latestBlockhashResult, feePayer: authResult.publicKey, - }).add(ix); + }).add(instruction); const signature = await wallet.signAndSendTransactions({ transactions: [transaction], }); showToastOrAlert(`Transaction successful! ${signature}`); }) - .catch(e => { - console.log(e); - showToastOrAlert(`Error: ${JSON.stringify(e)}`); + .catch(error => { + console.log(error); + showToastOrAlert(`Error: ${JSON.stringify(error)}`); }) .finally(() => { setIsTransactionInProgress(false); diff --git a/components/CounterView.tsx b/components/CounterView.tsx index 20ddd37..a4929ab 100644 --- a/components/CounterView.tsx +++ b/components/CounterView.tsx @@ -34,8 +34,8 @@ export function CounterView() { accountInfo.data, ); setCounter(data); - } catch (e) { - console.log("account decoding error: " + e); + } catch (error) { + console.log("account decoding error: " + error); } }, );