Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 3a27a85

Browse files
committed
Display wait screen after password input until lndReady
1 parent f1ea6c2 commit 3a27a85

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/action/wallet.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { observe } from 'mobx';
12
import { toBuffer, parseSat, checkHttpStatus, nap } from '../helper';
23
import { MIN_PASSWORD_LENGTH, NOTIFICATION_DELAY } from '../config';
34
import * as log from './log';
@@ -132,7 +133,8 @@ class WalletAction {
132133
wallet_password: toBuffer(walletPassword),
133134
});
134135
this._store.walletUnlocked = true;
135-
this._nav.goHome();
136+
this._nav.goWait();
137+
observe(this._store, 'lndReady', () => this._nav.goHome());
136138
} catch (err) {
137139
this._notification.display({ type: 'error', msg: 'Invalid password' });
138140
}

test/unit/action/wallet.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ describe('Action Wallet Unit Tests', () => {
238238
expect(grpc.sendUnlockerCommand, 'was called with', 'UnlockWallet', {
239239
wallet_password: Buffer.from('baz', 'utf8'),
240240
});
241+
expect(nav.goWait, 'was called once');
242+
expect(nav.goHome, 'was not called');
243+
store.lndReady = true;
241244
expect(nav.goHome, 'was called once');
242245
});
243246

@@ -247,7 +250,7 @@ describe('Action Wallet Unit Tests', () => {
247250
.rejects(new Error('Boom!'));
248251
await wallet.unlockWallet({ walletPassword: 'baz' });
249252
expect(notification.display, 'was called once');
250-
expect(nav.goHome, 'was not called');
253+
expect(nav.goWait, 'was not called');
251254
});
252255
});
253256

0 commit comments

Comments
 (0)