Skip to content

Commit

Permalink
Resolve TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis committed Jan 13, 2025
1 parent 1c35c5f commit 98b6447
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions wallets/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMe } from '@/components/me'
import { FAILED_INVOICES, SET_WALLET_PRIORITY, WALLETS } from '@/fragments/wallet'
import { FAST_POLL_INTERVAL, SSR } from '@/lib/constants'
import { NORMAL_POLL_INTERVAL, SSR } from '@/lib/constants'
import { useApolloClient, useMutation, useQuery } from '@apollo/client'
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react'
import { getStorageKey, getWalletByType, walletPrioritySort, canSend, isConfigured, upsertWalletVariables, siftConfig, saveWalletLocally } from './common'
Expand Down Expand Up @@ -238,7 +238,6 @@ function RetryHandler ({ children }) {
useEffect(() => {
(async () => {
for (const invoice of failedInvoices) {
// TODO: don't retry forever
const newInvoice = await invoiceHelper.retry(invoice)
waitForWalletPayment(newInvoice).catch(console.error)
}
Expand All @@ -251,9 +250,8 @@ function RetryHandler ({ children }) {
function useFailedInvoices () {
const wallets = useSendWallets()

// TODO: use longer poll interval in prod?
const { data } = useQuery(FAILED_INVOICES, {
pollInterval: FAST_POLL_INTERVAL,
pollInterval: NORMAL_POLL_INTERVAL,
skip: wallets.length === 0,
notifyOnNetworkStatusChange: true
})
Expand Down

0 comments on commit 98b6447

Please sign in to comment.