Skip to content

Commit

Permalink
Add more TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis committed Dec 28, 2023
1 parent 17c0b88 commit 4bc3615
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/webln.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ export function WebLNProvider ({ children }) {
}, [])

// poll balance
// TODO is there a better way?
useEffect(() => {
if (!provider) return
const BALANCE_POLL = 15000 // 1 minute
// TODO check rate limiting of services - is every 15 seconds too often? (it probably is)
const BALANCE_POLL = 15000 // 15 seconds
const interval = setInterval(() => {
provider?.getBalance().then(({ balance }) => setBalance(balance)).catch(console.error)
}, BALANCE_POLL)
Expand Down

0 comments on commit 4bc3615

Please sign in to comment.