Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
KKA11010 committed Feb 23, 2025
1 parent 502fc1e commit 4436784
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/context/FocusClaim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ const useFocusClaim = () => {
return true
}
for (let i = 0; i < 10; i++) {
// eslint-disable-next-line no-await-in-loop
if (await fn() || isSpent) { return }
// eslint-disable-next-line no-await-in-loop
await sleep(50)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/context/History.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-await-in-loop */
import { delInvoice, getAllInvoices, getInvoiceByPr } from '@db'
import { l } from '@log'
import type { IHistoryEntry } from '@model'
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function Dashboard({ navigation, route }: TDashboardPageProps) {
return
}
for (const mint of tokenInfo.mints) {
// eslint-disable-next-line no-await-in-loop
await addMint(mint)
}
// add token to db
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Payment/Receive/nostrDM/Token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function Token({ sender, token, id, dms, setDms, mints }: ITokenP
const handleTrustModal = async () => {
if (!info) { return }
for (const mint of info.mints) {
// eslint-disable-next-line no-await-in-loop
await addMint(mint)
}
// add token to db
Expand Down
2 changes: 1 addition & 1 deletion src/screens/QRScan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function QRScanPage({ navigation, route }: TQRScanPageProps) {
return setTrustModal(false)
}
for (const mint of tokenInfo.mints) {
// eslint-disable-next-line no-await-in-loop
await addMint(mint)
}
stopLoading()
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Restore/Seed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function SeedScreen({ navigation, route: { params } }: ISeedPageP
return openPromptAutoClose({ msg: t('noMintForCounter'), success: false })
}
for (const mint of allMints) {
// eslint-disable-next-line no-await-in-loop
await incrementCounterByMintUrl(mint.mintUrl, incrementValue)
}
setCounterOpen(false)
Expand Down
10 changes: 5 additions & 5 deletions src/wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ export async function isTokenSpendable(token: string): Promise<boolean> {
const useableTokenProofs: Proof[] = []
for (const t of decoded.token) {
if (!t?.proofs?.length) { continue }
// eslint-disable-next-line no-await-in-loop
const w = await getWallet(t.mint)
// eslint-disable-next-line no-await-in-loop
const usedSecrets = (await w.checkProofsSpent(t.proofs)).map(x => x.secret)
if (usedSecrets.length === t.proofs.length) {
// usedTokens.push(token)
Expand Down Expand Up @@ -144,7 +144,7 @@ export async function claimToken(encodedToken: string): Promise<boolean> {
}
}
for (const mint of mintUrls) {
// eslint-disable-next-line no-await-in-loop
await addMint(mint)
}
if (!token?.token?.length) { return false }
Expand Down Expand Up @@ -364,13 +364,13 @@ async function requestTokenLoop(): Promise<void> {
}
for (const invoice of invoices) {
try {
// eslint-disable-next-line no-await-in-loop
await requestToken(invoice.mintUrl, invoice.amount, invoice.hash)
// TODO notify user and add history entry
} catch {/* ignore */ }
const { expiry } = decodeLnInvoice(invoice.pr)
const date = new Date((invoice.time * 1000) + (expiry * 1000)).getTime()
// eslint-disable-next-line no-await-in-loop
if (Date.now() > date) { await delInvoice(invoice.hash) }
}
isRequestTokenLoopRunning = false
Expand Down

0 comments on commit 4436784

Please sign in to comment.