This repository was archived by the owner on Feb 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,10 @@ class AtplAction {
3636 * @return {Promise<undefined> }
3737 */
3838 async toggle ( ) {
39- const success = await this . _setStatus ( ! this . _store . settings . autopilot ) ;
39+ const newState = ! this . _store . settings . autopilot ;
40+ const success = await this . _setStatus ( newState ) ;
4041 if ( success ) {
41- this . _store . settings . autopilot = ! this . _store . settings . autopilot ;
42+ this . _store . settings . autopilot = newState ;
4243 this . _db . save ( ) ;
4344 }
4445 }
Original file line number Diff line number Diff line change 8989 * lnd node all balances, channels and transactions are fetched.
9090 */
9191when (
92- ( ) => store . lndReady && store . autopilotReady ,
92+ ( ) => store . lndReady ,
9393 ( ) => {
94- autopilot . init ( ) ;
9594 wallet . pollBalances ( ) ;
9695 wallet . pollExchangeRate ( ) ;
9796 channel . pollChannels ( ) ;
@@ -101,3 +100,15 @@ when(
101100 info . pollInfo ( ) ;
102101 }
103102) ;
103+
104+ /**
105+ * Initialize autopilot after syncing is finished and the grpc client
106+ * is ready
107+ */
108+ when (
109+ ( ) => store . syncedToChain && store . autopilotReady ,
110+ async ( ) => {
111+ await nap ( ) ;
112+ autopilot . init ( ) ;
113+ }
114+ ) ;
You can’t perform that action at this time.
0 commit comments