From e4773bda5b20f03eb75d86a26ea1cb3e9c548b48 Mon Sep 17 00:00:00 2001 From: Akojede Olorundara Date: Fri, 4 Oct 2024 11:33:50 +0100 Subject: [PATCH] minor clarity improvement --- components/CounterButton.tsx | 10 +++++----- components/CounterView.tsx | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) 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); } }, );