Wire up autopilot in mobile action init

parent 5784c6b0
...@@ -88,7 +88,13 @@ when(() => store.unlockerReady, () => wallet.init()); ...@@ -88,7 +88,13 @@ when(() => store.unlockerReady, () => wallet.init());
* Triggered after the user's password has unlocked the wallet * Triggered after the user's password has unlocked the wallet
* or a user's password has been successfully reset. * or a user's password has been successfully reset.
*/ */
when(() => store.walletUnlocked, () => grpc.initLnd()); when(
() => store.walletUnlocked,
async () => {
await grpc.initLnd();
await grpc.initAutopilot();
}
);
/** /**
* Triggered once the main lnd grpc client is initialized. This is when * Triggered once the main lnd grpc client is initialized. This is when
...@@ -107,6 +113,17 @@ when( ...@@ -107,6 +113,17 @@ when(
} }
); );
/**
* Initialize autopilot after syncing is finished and the grpc client
* is ready
*/
when(
() => store.syncedToChain && store.autopilotReady,
() => {
autopilot.init();
}
);
// STUB DURING DEVELOPMENT // STUB DURING DEVELOPMENT
sinon.stub(wallet, 'update'); sinon.stub(wallet, 'update');
sinon.stub(wallet, 'getExchangeRate'); sinon.stub(wallet, 'getExchangeRate');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment