moves most of the fx that are suppose to happen only at app startup
to an init/start-app fn so that init/initialize-app which is also
called after logout doesn't repeat unecessary fxs
- move db and models ns to browser module
- remove browser navigation/preload-data
- rewrite dapp-permission logic and move code to permissions ns
- rewrite all browser events according to guidelines and move them to
`status-im.events` ns
- rewrite tests for browser and permissions
Client with versions 0.9.26/27 who recovered their accounts weren't
asked for PN permissions so we now check permissions after user signs in.
Signed-off-by: Dmitry Novotochinov <dmitry.novot@gmail.com>
`get-unviewed-messages` cofx was using the `current-public-key`
field from app-db
since it is not set at the point cofx are computed during the init
phase this field is nil and therefore no unread messages were found
the fix changes the cofx so that it returns a function as it is
already done for many cofx that needs parameters that are not
known at the time cofx are computed.
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
simplified flow:
- event `:ui/login` is dispatched
- node is initialized with user config or default config
- `node.started` signal is received, applying `:login` fx
- `:callback/login` event is dispatched, account is changed
in datastore, web-data is cleared
- `:init/initialize-account` event is dispatched
replace event dispatches by function composition
fix bug in universal links where url to be processed after login
was never removed
Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>