[FIX #3852] Back button refinements
This commit is contained in:
parent
0ed067af6a
commit
8effc5974f
|
@ -20,12 +20,16 @@
|
|||
;; in handlers
|
||||
(let [stack (subscribe [:get :navigation-stack])
|
||||
result-box (subscribe [:get-current-chat-ui-prop :result-box])
|
||||
webview (subscribe [:get :webview-bridge])]
|
||||
webview (subscribe [:get :webview-bridge])
|
||||
view-id (subscribe [:get :view-id])]
|
||||
(cond
|
||||
|
||||
(and @webview (:can-go-back? @result-box))
|
||||
(do (.goBack @webview) true)
|
||||
|
||||
(#{:home :wallet :my-profile} view-id)
|
||||
(do (.exitApp react/back-handler))
|
||||
|
||||
(< 1 (count @stack))
|
||||
(do (dispatch [:navigate-back]) true)
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
(if (= chat-id constants/console-chat-id)
|
||||
[toolbar/simple-toolbar name]
|
||||
[toolbar/platform-agnostic-toolbar {}
|
||||
toolbar/nav-back-count
|
||||
(toolbar/nav-back-count {:home? true})
|
||||
[toolbar-content/toolbar-content-view]
|
||||
[toolbar/actions [{:icon :icons/options
|
||||
:icon-opts {:color :black
|
||||
|
|
|
@ -18,9 +18,14 @@
|
|||
|
||||
(def default-handler #(re-frame/dispatch [:navigate-back]))
|
||||
|
||||
(def home-handler #(re-frame/dispatch [:navigate-to-clean :home]))
|
||||
|
||||
(def default-back
|
||||
(back default-handler))
|
||||
|
||||
(def home-back
|
||||
(back home-handler))
|
||||
|
||||
(defn back-white [handler]
|
||||
{:icon :icons/back
|
||||
:icon-opts {:color :white}
|
||||
|
|
|
@ -51,7 +51,11 @@
|
|||
|
||||
(def default-nav-back [nav-button actions/default-back])
|
||||
|
||||
(def nav-back-count [nav-button-with-count actions/default-back])
|
||||
(defn nav-back-count
|
||||
([]
|
||||
[nav-button-with-count actions/default-back])
|
||||
([{:keys [home?]}]
|
||||
[nav-button-with-count (if home? actions/home-back actions/default-back)]))
|
||||
|
||||
(defn default-done
|
||||
"Renders a touchable icon on Android or a label or iOS."
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
[react/keyboard-avoiding-view styles/browser
|
||||
[status-bar/status-bar]
|
||||
[toolbar.view/toolbar {}
|
||||
toolbar.view/nav-back-count
|
||||
(toolbar.view/nav-back-count)
|
||||
(if dapp?
|
||||
[toolbar-content-dapp contact unread-messages-number]
|
||||
[toolbar-content browser unread-messages-number])]
|
||||
|
|
Loading…
Reference in New Issue