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

Commit 563a601

Browse files
authored
Merge pull request #709 from lightninglabs/syncing-complete-notify
Display syncing complete notification
2 parents 453adbd + d9c0f90 commit 563a601

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/action/info.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ class InfoAction {
3636
msg: `Syncing to chain (block: ${response.block_height})`,
3737
wait: true,
3838
});
39-
log.info(`Syncing to chain ... block height: ${response.block_height}`);
4039
this._store.percentSynced = this.calcPercentSynced(response);
40+
} else {
41+
this._notification.display({
42+
type: 'success',
43+
msg: 'Syncing complete',
44+
});
4145
}
4246
return response.synced_to_chain;
4347
} catch (err) {

test/unit/action/info.spec.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,16 @@ describe('Action Info Unit Tests', () => {
5555
});
5656
});
5757

58-
it('should not show notification if synced', async () => {
58+
it('should show completed notification if synced', async () => {
5959
grpc.sendCommand.withArgs('getInfo').resolves({
6060
synced_to_chain: true,
61-
block_height: 1234,
6261
});
6362
await info.getInfo();
64-
expect(notification.display, 'was not called');
63+
expect(notification.display, 'was called once');
64+
expect(notification.display, 'was called with', {
65+
type: 'success',
66+
msg: 'Syncing complete',
67+
});
6568
});
6669

6770
it('should return true if chain is synced', async () => {

0 commit comments

Comments
 (0)