Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(wallet): prevent reinit on lnurl change
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Oct 4, 2020
1 parent eb17209 commit c773c33
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions renderer/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,6 @@ const App = ({
// initialize backup service in forceUseTokens mode to avoid
// launching it for wallets that don't have backup setup
initBackupService()
if (lnurlAuthParams && !willShowLnurlAuthPrompt) {
finishLnurlAuth()
}
if (lnurlChannelParams && !willShowLnurlChannelPrompt) {
finishLnurlChannel()
}
if (lnurlWithdrawParams && !willShowLnurlWithdrawPrompt) {
finishLnurlWithdraw()
}

return () => {
appScheduler.removeAllTasks()
Expand All @@ -110,10 +101,24 @@ const App = ({
fetchDescribeNetwork,
fetchPeers,
fetchSuggestedNodes,
fetchTransactions,
initBackupService,
initTickers,
setIsWalletOpen,
updateAutopilotNodeScores,
])

useEffect(() => {
if (lnurlAuthParams && !willShowLnurlAuthPrompt) {
finishLnurlAuth()
}
if (lnurlChannelParams && !willShowLnurlChannelPrompt) {
finishLnurlChannel()
}
if (lnurlWithdrawParams && !willShowLnurlWithdrawPrompt) {
finishLnurlWithdraw()
}
}, [
finishLnurlAuth,
finishLnurlChannel,
finishLnurlWithdraw,
Expand Down

0 comments on commit c773c33

Please sign in to comment.