Refactor Containers and Routes in order to make the code a little more
readable, reduce duplication, and prepare the codebase for integration
of the new Home screen.
- Break out the Root container into several smaller containers that are
responsible for connecting themselves to the Redux store.
- Use routing for navigation between primary containers
- Unbundle the `Syncing` Component from the Onboarding section and hook
up to router so that it can be access by navigating to `/syncing' (we
want to be able to load existing wallets and initiate syncing outside of
the context of the onboarding process)
- Reduce code duplication
- Create `TitleBar` component and implement once at the top level
- Create `withLoading` HOC and use to display the loading screen when
needed.
By not loading locale data into the main process we can considerably
reduce it's size. We the only thing we need access to in the main
process is the translation sets (used for the languages menu).
refactor the i18n code so that the locale data can only be loaded when
needed (in the renderer).
If there is a problem connecting to the Lightning interface on a local
lnd instance, return the user to the onboarding screen and show the
user the error message.
Previously, the app would hang on an infinite loading screen.
Select free ports for lnd from a pool of options. By default we will
use the standard lnd ports (10009 and 9735) but if those are not
available then we will search for free ports in a nearby range.
This allows us to have multiple instances of the wallet running and
avoids possible conflicts with other instances of lnd that the user
may be running.
Consolidate the flow for local and remote wallet connections for
consolidate. When unlocking a local wallet wait for the macaroon to be
generated before we try to use it.
There is no need to check wether an lnd process exists and prevent
Zap from starting if so. We don't care if there is another process
running. We only care that we can successfully start up our own process.
If there is a conflict with another lnd process such as a port that we
need already being in use we already handle this elsewhere in our code.
If when connecting to a remote wallet we detect that it is locked
initialise the wallet unlocker to allow users to unlock their remote
wallets.
Fix#543
When connecting to a remote wallet we assume that the wallet is already
unlocked. In the case where it is not already unlocked, forward the
error message to the UI.
Fix#738
Fix an issue that was preventing grpc connection errors from showing
after a failed connection to a remote node.
Re-throw the error from `startLightningWallet` after logging it so that
it can be handled properly afterwards.
Lnd doesn't currently do a graceful shutdown when a `SIGTERM` is issued.
To ensure a graceful shutdown, call `stopDaemon` on the gRPC interface
prior to terminating lnd. If a graceful shutdown is unsuccessful then
force kill the daemon.
The `onOnboarding` state transition handler only fires if you are
entering the `onboarding` state from another state. If you are already
in the `onboarding` state it does not fire when the `startOnboarding`
event is initiated. By contrast, `onStartOnboarding` always fires when
`startOnboarding` is run.
Ensure that IPC listeners are only registered once when transitioning to
the `onboarding` state from another state.
If a full refresh is done from within the app (`cmd + r`) restart the
onboarding process from the beginning, including stopping lnd and
disconnecting any active connections.
Fix#641
On darwin, we keep the app running and just hide it when the window is
closed as that is the standard convention. On linux and windows the app
should be quit when the window is closed.
This resolves an issue where on linux/windows the app would remain open
when the window is closed, with no way to properly quit it short of
doing a force quit.