Browse Source

Merge pull request #701 from mrfelton/fix/invalid-state-after-double-refresh

fix(wallet): ensure clean state after refresh
renovate/lint-staged-8.x
JimmyMow 6 years ago
committed by GitHub
parent
commit
48280c1086
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      app/lib/zap/controller.js

10
app/lib/zap/controller.js

@ -130,9 +130,12 @@ class ZapController {
onOnboarding() { onOnboarding() {
mainLog.debug('[FSM] onOnboarding...') mainLog.debug('[FSM] onOnboarding...')
// Deregister IPC listeners so that we can start fresh. // Remove any existing IPC listeners so that we can start fresh.
this._removeIpcListeners() this._removeIpcListeners()
// Register IPC listeners so that we can react to instructions coming from the app.
this._registerIpcListeners()
// Ensure wallet is disconnected. // Ensure wallet is disconnected.
this.disconnectLightningWallet() this.disconnectLightningWallet()
@ -148,9 +151,6 @@ class ZapController {
onStartOnboarding() { onStartOnboarding() {
mainLog.debug('[FSM] onStartOnboarding...') mainLog.debug('[FSM] onStartOnboarding...')
// Register IPC listeners so that we can react to instructions coming from the app.
this._registerIpcListeners()
// Notify the app to start the onboarding process. // Notify the app to start the onboarding process.
this.sendMessage('startOnboarding', this.lndConfig) this.sendMessage('startOnboarding', this.lndConfig)
} }
@ -410,7 +410,7 @@ class ZapController {
process.env.GRPC_SSL_CIPHER_SUITES || grpcSslCipherSuites(options.type) process.env.GRPC_SSL_CIPHER_SUITES || grpcSslCipherSuites(options.type)
// If the requested connection type is a local one then start up a new lnd instance. // If the requested connection type is a local one then start up a new lnd instance.
// // Otherwise attempt to connect to an lnd instance using user supplied connection details. // Otherwise attempt to connect to an lnd instance using user supplied connection details.\
return options.type === 'local' ? this.startLnd() : this.connectLnd() return options.type === 'local' ? this.startLnd() : this.connectLnd()
} }

Loading…
Cancel
Save