mirror of
https://github.com/status-im/status-react.git
synced 2025-02-22 15:48:50 +00:00
[#10377] [perfromance] Improve sign in flow
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
309987cc89
commit
fcf1a91507
File diff suppressed because it is too large
Load Diff
@ -267,7 +267,8 @@
|
||||
(fx/merge cofx
|
||||
{:db (assoc db :browser/options
|
||||
{:browser-id (:browser-id browser)})}
|
||||
(navigation/navigate-to-cofx :browser nil)
|
||||
(navigation/navigate-to-cofx :browser-stack {:screen :browser
|
||||
:initial false})
|
||||
(update-browser browser)
|
||||
(resolve-url nil)))))
|
||||
|
||||
|
@ -90,7 +90,8 @@
|
||||
(fx/merge
|
||||
cofx
|
||||
(bottom-sheet/hide-bottom-sheet)
|
||||
(navigation/navigate-to-cofx :mobile-network-settings {}))))
|
||||
(navigation/navigate-to-cofx :profile-stack {:screen :mobile-network-settings
|
||||
:initial false}))))
|
||||
|
||||
;;:mobile-network-offline
|
||||
|
||||
|
@ -12,14 +12,14 @@
|
||||
|
||||
(fx/defn navigate-to-cofx
|
||||
[{:keys [db]} go-to-view-id screen-params]
|
||||
(let [db (cond-> (assoc db :view-id go-to-view-id)
|
||||
|
||||
;; TODO: Inspect the need of screen-params
|
||||
(seq screen-params)
|
||||
(assoc-in [:navigation/screen-params go-to-view-id]
|
||||
screen-params))]
|
||||
{:db db
|
||||
::navigate-to [go-to-view-id screen-params]}))
|
||||
{:db
|
||||
(cond-> (assoc db :view-id go-to-view-id)
|
||||
;; TODO: Inspect the need of screen-params
|
||||
(and (seq screen-params) (:screen screen-params) (:params screen-params))
|
||||
(assoc-in [:navigation/screen-params (:screen screen-params)] (:params screen-params))
|
||||
(seq screen-params)
|
||||
(assoc-in [:navigation/screen-params go-to-view-id] screen-params))
|
||||
::navigate-to [go-to-view-id screen-params]})
|
||||
|
||||
(fx/defn navigate-replace-cofx
|
||||
[{:keys [db]} go-to-view-id screen-params]
|
||||
|
@ -29,7 +29,7 @@
|
||||
;; TODO(Ferossgp): Add two-pane navigator on chat-stack
|
||||
(defn tabs []
|
||||
[bottom-tabs {:initial-route-name :chat-stack
|
||||
:lazy false
|
||||
:lazy true
|
||||
:header-mode :none
|
||||
:tab-bar tabbar/tabbar}
|
||||
[{:name :chat-stack
|
||||
|
@ -62,8 +62,10 @@
|
||||
(assoc-error-message :balance-update :error-unable-to-get-token-balance))})
|
||||
|
||||
(fx/defn open-transaction-details
|
||||
[{:keys [db] :as cofx} hash address]
|
||||
(navigation/navigate-to-cofx cofx :wallet-transaction-details {:hash hash :address address}))
|
||||
[cofx hash address]
|
||||
(navigation/navigate-to-cofx cofx :wallet-stack {:screen :wallet-transaction-details
|
||||
:initial false
|
||||
:params {:hash hash :address address}}))
|
||||
|
||||
(defn- validate-token-name!
|
||||
[{:keys [address symbol name]}]
|
||||
|
@ -3,12 +3,6 @@
|
||||
[status-im.browser.core :as browser]
|
||||
[status-im.utils.http :as http]))
|
||||
|
||||
(defn has-navigated-to-browser? [result]
|
||||
(and (= (get result :status-im.ui.screens.navigation/navigate-to)
|
||||
[:browser nil])
|
||||
(= (get-in result [:db :view-id])
|
||||
:browser)))
|
||||
|
||||
(defn has-wrong-properties?
|
||||
[result dapp-url expected-browser]
|
||||
(let [browser (get-in result [:db :browser/browsers dapp-url])]
|
||||
@ -33,8 +27,6 @@
|
||||
dapp1-id (get-dapp-id result-open dapp1-url)]
|
||||
(is (= dapp1-id (get-in result-open [:db :browser/options :browser-id]))
|
||||
"browser-id should be dapp1-url")
|
||||
(is (has-navigated-to-browser? result-open)
|
||||
"should navigate to :browser")
|
||||
(is (not (has-wrong-properties? result-open
|
||||
dapp1-id
|
||||
{:browser-id dapp1-id
|
||||
@ -52,8 +44,6 @@
|
||||
dapp2-id (get-dapp-id result-open-2 dapp2-url)]
|
||||
(is (= dapp2-id (get-in result-open-2 [:db :browser/options :browser-id]))
|
||||
"browser-id should be dapp2 host")
|
||||
(is (has-navigated-to-browser? result-open-2)
|
||||
"should navigate to :browser")
|
||||
(is (not (has-wrong-properties? result-open-2
|
||||
dapp2-id
|
||||
{:browser-id dapp2-id
|
||||
|
Loading…
x
Reference in New Issue
Block a user