Skip to content
Permalink
Browse files

fix(onboarding): disable login button until success

Fix #2229
  • Loading branch information...
mrfelton committed May 16, 2019
1 parent 82539f4 commit d66a2747c045326c7de2d25dcd859099bee200ad
Showing with 10 additions and 2 deletions.
  1. +10 −2 renderer/reducers/lnd.js
@@ -259,12 +259,20 @@ export const setWalletUnlockerGrpcActive = () => ({
*/
export const unlockWallet = password => async dispatch => {
dispatch({ type: UNLOCK_WALLET })
let waitForState
try {
const grpc = await grpcService
waitForState = await grpc.waitForState('active')
await grpc.services.WalletUnlocker.unlockWallet({ wallet_password: Buffer.from(password) })
await waitForState.isDone
dispatch(walletUnlocked())
} catch (e) {
dispatch(setUnlockWalletError(e.message))
} catch (error) {
// Remove Lightning gRPC activation listener.
if (waitForState) {
await waitForState.cancel()
}
// Notify of wallet unlock failure.
dispatch(setUnlockWalletError(error.message))
}
}

0 comments on commit d66a274

Please sign in to comment.
You can’t perform that action at this time.