From 23fda6e85470c9dccfe8bb9a1bdae5ec400bd0ae Mon Sep 17 00:00:00 2001 From: "Tone T. Thangsongcharoen" Date: Mon, 1 Apr 2024 11:56:30 -0500 Subject: [PATCH] fix lint issues --- src/main/main.ts | 6 +++--- src/renderer/src/components/QrScanner.tsx | 1 + src/renderer/src/utils/sendTokens.ts | 9 +++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/main.ts b/src/main/main.ts index d7d7093..d58135f 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -1,6 +1,5 @@ -/* eslint global-require: off, no-console: off, promise/always-return: off */ - -/** +/* eslint-disable */ +/*** * This module executes inside of electron's main process. You can start * electron renderer process from here and communicate with the other processes * through IPC. @@ -8,6 +7,7 @@ * When running `npm run build` or `npm run build:main`, this file is compiled to * `./src/main.js` using webpack. This gives us some performance wins. */ + import 'dotenv/config'; import { config } from 'dotenv'; import path from 'path'; diff --git a/src/renderer/src/components/QrScanner.tsx b/src/renderer/src/components/QrScanner.tsx index ea1f45a..9294eeb 100644 --- a/src/renderer/src/components/QrScanner.tsx +++ b/src/renderer/src/components/QrScanner.tsx @@ -18,6 +18,7 @@ const BootstrapDialog = styled(Dialog)(({ theme }) => ({ }, })); + /* @ts-ignore */ export default function QrScanner({ isOpen, onScan, onError, onClose }) { return ( diff --git a/src/renderer/src/utils/sendTokens.ts b/src/renderer/src/utils/sendTokens.ts index 9befcec..6029166 100644 --- a/src/renderer/src/utils/sendTokens.ts +++ b/src/renderer/src/utils/sendTokens.ts @@ -43,6 +43,8 @@ const sendTokens = async (sa, t, amt, pm = true) => { const saAddress = await smartAccount.getAccountAddress(); console.log('SA Address', saAddress); + let txHash = null; + if (pm) { // ------ 4. Send user operation and get tx hash const tx = await smartAccount.sendTransaction(transferTx, { @@ -55,7 +57,7 @@ const sendTokens = async (sa, t, amt, pm = true) => { console.log('transactionHash', transactionHash); alert(`Transaction Successful: ${transactionHash}`); - return transactionHash; + txHash = transactionHash; } else { // ------ 4. Send user operation and get tx hash const tx = await smartAccount.sendTransaction(transferTx); @@ -64,10 +66,13 @@ const sendTokens = async (sa, t, amt, pm = true) => { console.log('transactionHash', transactionHash); alert(`Transaction Successful: ${transactionHash}`); - return transactionHash; + txHash = transactionHash; } + return txHash; } catch (err) { alert(`Transaction Error: ${err}`); + + return null; } };