fix #1117
This commit is contained in:
parent
b5edab5a21
commit
0359c2819b
|
@ -5,6 +5,7 @@
|
||||||
[status-im.components.common.common :as common]
|
[status-im.components.common.common :as common]
|
||||||
[status-im.components.sticky-button :as sticky-button]
|
[status-im.components.sticky-button :as sticky-button]
|
||||||
[status-im.components.status-bar :as status-bar]
|
[status-im.components.status-bar :as status-bar]
|
||||||
|
[status-im.components.sync-state.offline :as offline-view]
|
||||||
[status-im.components.toolbar-new.actions :as act]
|
[status-im.components.toolbar-new.actions :as act]
|
||||||
[status-im.components.toolbar-new.view :as toolbar]
|
[status-im.components.toolbar-new.view :as toolbar]
|
||||||
[status-im.i18n :as i18n]
|
[status-im.i18n :as i18n]
|
||||||
|
@ -51,9 +52,12 @@
|
||||||
(defview transaction-details []
|
(defview transaction-details []
|
||||||
[{:keys [id] :as transaction} [:get :selected-transaction]
|
[{:keys [id] :as transaction} [:get :selected-transaction]
|
||||||
{:keys [password]} [:get :confirm-transactions]
|
{:keys [password]} [:get :confirm-transactions]
|
||||||
confirmed? [:get-in [:transaction-details-ui-props :confirmed?]]]
|
confirmed? [:get-in [:transaction-details-ui-props :confirmed?]]
|
||||||
|
sync-state [:get :sync-state]
|
||||||
|
network-status [:get :network-status]]
|
||||||
{:component-did-update #(when-not transaction (rf/dispatch [:navigate-to-modal :unsigned-transactions]))
|
{:component-did-update #(when-not transaction (rf/dispatch [:navigate-to-modal :unsigned-transactions]))
|
||||||
:component-will-unmount #(rf/dispatch [:set-in [:transaction-details-ui-props :confirmed?] false])}
|
:component-will-unmount #(rf/dispatch [:set-in [:transaction-details-ui-props :confirmed?] false])}
|
||||||
|
(let [offline? (or (= network-status :offline) (= sync-state :offline))]
|
||||||
[rn/keyboard-avoiding-view {:style st/transactions-screen}
|
[rn/keyboard-avoiding-view {:style st/transactions-screen}
|
||||||
[status-bar/status-bar {:type :transaction}]
|
[status-bar/status-bar {:type :transaction}]
|
||||||
[toolbar-view]
|
[toolbar-view]
|
||||||
|
@ -61,7 +65,9 @@
|
||||||
[transactions-list-item/view transaction #(rf/dispatch [:navigate-to-modal :unsigned-transactions])]
|
[transactions-list-item/view transaction #(rf/dispatch [:navigate-to-modal :unsigned-transactions])]
|
||||||
[common/separator st/details-separator st/details-separator-wrapper]
|
[common/separator st/details-separator st/details-separator-wrapper]
|
||||||
[details transaction]]
|
[details transaction]]
|
||||||
(when confirmed? [password-form/view 1])
|
(when (and confirmed? (not offline?))
|
||||||
|
[password-form/view 1])
|
||||||
|
(when-not offline?
|
||||||
(let [confirm-text (if confirmed?
|
(let [confirm-text (if confirmed?
|
||||||
(i18n/label :t/confirm)
|
(i18n/label :t/confirm)
|
||||||
(i18n/label-pluralize 1 :t/confirm-transactions))
|
(i18n/label-pluralize 1 :t/confirm-transactions))
|
||||||
|
@ -69,4 +75,5 @@
|
||||||
#(do (rf/dispatch [:accept-transaction password id])
|
#(do (rf/dispatch [:accept-transaction password id])
|
||||||
(rf/dispatch [:set :confirmed-transactions-count 1]))
|
(rf/dispatch [:set :confirmed-transactions-count 1]))
|
||||||
#(rf/dispatch [:set-in [:transaction-details-ui-props :confirmed?] true]))]
|
#(rf/dispatch [:set-in [:transaction-details-ui-props :confirmed?] true]))]
|
||||||
[sticky-button/sticky-button confirm-text confirm-fn])])
|
[sticky-button/sticky-button confirm-text confirm-fn]))
|
||||||
|
[offline-view/offline-view {:top (if platform/ios? 21 0)}]]))
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
[status-im.components.react :as rn]
|
[status-im.components.react :as rn]
|
||||||
[status-im.components.sticky-button :as sticky-button]
|
[status-im.components.sticky-button :as sticky-button]
|
||||||
[status-im.components.status-bar :as status-bar]
|
[status-im.components.status-bar :as status-bar]
|
||||||
|
[status-im.components.sync-state.offline :as offline-view]
|
||||||
[status-im.components.toolbar-new.actions :as act]
|
[status-im.components.toolbar-new.actions :as act]
|
||||||
[status-im.components.toolbar-new.view :as toolbar]
|
[status-im.components.toolbar-new.view :as toolbar]
|
||||||
[status-im.transactions.views.list-item :as transactions-list-item]
|
[status-im.transactions.views.list-item :as transactions-list-item]
|
||||||
|
@ -43,9 +44,12 @@
|
||||||
(defview unsigned-transactions []
|
(defview unsigned-transactions []
|
||||||
[transactions [:transactions]
|
[transactions [:transactions]
|
||||||
{:keys [password]} [:get :confirm-transactions]
|
{:keys [password]} [:get :confirm-transactions]
|
||||||
confirmed? [:get-in [:transactions-list-ui-props :confirmed?]]]
|
confirmed? [:get-in [:transactions-list-ui-props :confirmed?]]
|
||||||
|
sync-state [:get :sync-state]
|
||||||
|
network-status [:get :network-status]]
|
||||||
{:component-did-update #(when-not (seq transactions) (rf/dispatch [:navigate-back]))
|
{:component-did-update #(when-not (seq transactions) (rf/dispatch [:navigate-back]))
|
||||||
:component-will-unmount #(rf/dispatch [:set-in [:transactions-list-ui-props :confirmed?] false])}
|
:component-will-unmount #(rf/dispatch [:set-in [:transactions-list-ui-props :confirmed?] false])}
|
||||||
|
(let [offline? (or (= network-status :offline) (= sync-state :offline))]
|
||||||
[(if platform/ios? rn/keyboard-avoiding-view rn/view) (merge {:behavior :padding} st/transactions-screen)
|
[(if platform/ios? rn/keyboard-avoiding-view rn/view) (merge {:behavior :padding} st/transactions-screen)
|
||||||
[status-bar/status-bar {:type :transaction}]
|
[status-bar/status-bar {:type :transaction}]
|
||||||
[toolbar-view transactions]
|
[toolbar-view transactions]
|
||||||
|
@ -54,8 +58,9 @@
|
||||||
:dataSource (lw/to-datasource transactions)
|
:dataSource (lw/to-datasource transactions)
|
||||||
:renderSeparator (render-separator-fn (count transactions))
|
:renderSeparator (render-separator-fn (count transactions))
|
||||||
:renderRow render-row-fn}]
|
:renderRow render-row-fn}]
|
||||||
(when confirmed?
|
(when (and confirmed? (not offline?))
|
||||||
[password-form/view (count transactions)])]
|
[password-form/view (count transactions)])]
|
||||||
|
(when-not offline?
|
||||||
(let [confirm-text (if confirmed?
|
(let [confirm-text (if confirmed?
|
||||||
(i18n/label :t/confirm)
|
(i18n/label :t/confirm)
|
||||||
(i18n/label-pluralize (count transactions) :t/confirm-transactions))
|
(i18n/label-pluralize (count transactions) :t/confirm-transactions))
|
||||||
|
@ -63,4 +68,5 @@
|
||||||
#(do (rf/dispatch [:accept-transactions password])
|
#(do (rf/dispatch [:accept-transactions password])
|
||||||
(rf/dispatch [:set :confirmed-transactions-count (count transactions)]))
|
(rf/dispatch [:set :confirmed-transactions-count (count transactions)]))
|
||||||
#(rf/dispatch [:set-in [:transactions-list-ui-props :confirmed?] true]))]
|
#(rf/dispatch [:set-in [:transactions-list-ui-props :confirmed?] true]))]
|
||||||
[sticky-button/sticky-button confirm-text confirm-fn])])
|
[sticky-button/sticky-button confirm-text confirm-fn]))
|
||||||
|
[offline-view/offline-view {:top (if platform/ios? 21 0)}]]))
|
||||||
|
|
Loading…
Reference in New Issue