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

Commit

Permalink
fix(wallet): reset app right before launching lnd
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Oct 25, 2020
1 parent d48e387 commit a9bcc66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions renderer/components/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Home extends React.Component {
isWalletUnlockerGrpcActive: PropTypes.bool.isRequired,
lndConnect: PropTypes.string,
putWallet: PropTypes.func.isRequired,
resetApp: PropTypes.func.isRequired,
setActiveWallet: PropTypes.func.isRequired,
setIsWalletOpen: PropTypes.func.isRequired,
setUnlockWalletError: PropTypes.func.isRequired,
Expand Down Expand Up @@ -77,6 +78,7 @@ class Home extends React.Component {
wallets,
setActiveWallet,
clearStartLndError,
resetApp,
showError,
stopLnd,
isNeutrinoRunning,
Expand Down Expand Up @@ -135,6 +137,7 @@ class Home extends React.Component {
isStartingLnd={isStartingLnd}
isWalletUnlockerGrpcActive={isWalletUnlockerGrpcActive}
putWallet={putWallet}
resetApp={resetApp}
showError={showError}
showNotification={showNotification}
startLnd={startLnd}
Expand Down
4 changes: 3 additions & 1 deletion renderer/components/Home/WalletLauncher.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class WalletLauncher extends React.Component {
isStartingLnd: PropTypes.bool.isRequired,
isWalletUnlockerGrpcActive: PropTypes.bool.isRequired,
putWallet: PropTypes.func.isRequired,
resetApp: PropTypes.func.isRequired,
showError: PropTypes.func.isRequired,
showNotification: PropTypes.func.isRequired,
startLnd: PropTypes.func.isRequired,
Expand Down Expand Up @@ -259,8 +260,9 @@ class WalletLauncher extends React.Component {

launchWallet = async () => {
try {
const { startLnd, wallet } = this.props
const { resetApp, startLnd, wallet } = this.props
// discard settings edits and just launch current saved config
resetApp()
return await startLnd(wallet)
} catch (e) {
// this error is handled via startLndErrors mechanism
Expand Down
2 changes: 2 additions & 0 deletions renderer/containers/Home/Home.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import { connect } from 'react-redux'
import { resetApp } from 'reducers/app'
import { neutrinoSelectors } from 'reducers/neutrino'
import {
setActiveWallet,
Expand Down Expand Up @@ -51,6 +52,7 @@ const mapDispatchToProps = {
clearStartLndError,
stopLnd,
putWallet,
resetApp,
showNotification,
startLnd,
unlockWallet,
Expand Down

0 comments on commit a9bcc66

Please sign in to comment.