Hide option to increase gas on keycard

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2020-12-28 09:21:52 +01:00
parent 33e58dbca9
commit 37ccc6f825
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
2 changed files with 14 additions and 2 deletions

View File

@ -605,6 +605,7 @@
(fn [multiaccounts] (fn [multiaccounts]
(> (count multiaccounts) 1))) (> (count multiaccounts) 1)))
;; NOTE: this subscription only works on login
(re-frame/reg-sub (re-frame/reg-sub
:multiaccounts.login/keycard-account? :multiaccounts.login/keycard-account?
:<- [:multiaccounts/multiaccounts] :<- [:multiaccounts/multiaccounts]
@ -612,6 +613,12 @@
(fn [[multiaccounts {:keys [key-uid]}]] (fn [[multiaccounts {:keys [key-uid]}]]
(get-in multiaccounts [key-uid :keycard-pairing]))) (get-in multiaccounts [key-uid :keycard-pairing])))
(re-frame/reg-sub
:multiaccounts/keycard-account?
:<- [:multiaccount]
(fn [multiaccount]
(:keycard-pairing multiaccount)))
(re-frame/reg-sub (re-frame/reg-sub
:accounts-without-watch-only :accounts-without-watch-only
:<- [:multiaccount/accounts] :<- [:multiaccount/accounts]

View File

@ -38,7 +38,8 @@
(defn render-transaction (defn render-transaction
[{:keys [label contact address contact-accessibility-label [{:keys [label contact address contact-accessibility-label
address-accessibility-label currency-text amount-text address-accessibility-label currency-text amount-text
time-formatted on-touch-fn type hash]}] time-formatted on-touch-fn type hash]}
_ _ {:keys [keycard-account?]}]
[react/view [react/view
[list/touchable-item on-touch-fn [list/touchable-item on-touch-fn
[react/view {:accessibility-label :transaction-item} [react/view {:accessibility-label :transaction-item}
@ -75,7 +76,8 @@
:style {:margin-top 10} :style {:margin-top 10}
:icon-opts (merge styles/forward :icon-opts (merge styles/forward
{:accessibility-label :show-transaction-button})}]]]] {:accessibility-label :show-transaction-button})}]]]]
(when (= type :pending) (when (and (not keycard-account?)
(= type :pending))
[react/view {:flex-direction :row :padding 16 :justify-content :space-between} [react/view {:flex-direction :row :padding 16 :justify-content :space-between}
[quo/button [quo/button
{:on-press #(re-frame/dispatch [:signing.ui/increase-gas-pressed hash])} {:on-press #(re-frame/dispatch [:signing.ui/increase-gas-pressed hash])}
@ -108,6 +110,8 @@
[transactions-history-sections address] [transactions-history-sections address]
(let [fetching-recent-history? @(re-frame/subscribe [:wallet/fetching-recent-tx-history? address]) (let [fetching-recent-history? @(re-frame/subscribe [:wallet/fetching-recent-tx-history? address])
fetching-more-history? @(re-frame/subscribe [:wallet/fetching-tx-history? address]) fetching-more-history? @(re-frame/subscribe [:wallet/fetching-tx-history? address])
keycard-account? @(re-frame/subscribe [:multiaccounts/keycard-account?])
all-fetched? @(re-frame/subscribe [:wallet/tx-history-fetched? address])] all-fetched? @(re-frame/subscribe [:wallet/tx-history-fetched? address])]
[react/view components.styles/flex [react/view components.styles/flex
[etherscan-link address] [etherscan-link address]
@ -121,6 +125,7 @@
[list/section-list [list/section-list
{:sections transactions-history-sections {:sections transactions-history-sections
:key-fn :hash :key-fn :hash
:render-data {:keycard-account? keycard-account?}
:render-fn render-transaction :render-fn render-transaction
:empty-component :empty-component
[react/i18n-text {:style styles/empty-text [react/i18n-text {:style styles/empty-text