fix unsigned transaction expiring while user checks details
previously one would get a red screen in develop and probably a white screen in the app now it shows a label indicating that the transaction has expired
This commit is contained in:
parent
0e63b09dcd
commit
748f1c6772
|
@ -325,6 +325,7 @@
|
||||||
:transaction "Transaction"
|
:transaction "Transaction"
|
||||||
:unsigned-transactions "Unsigned transactions"
|
:unsigned-transactions "Unsigned transactions"
|
||||||
:no-unsigned-transactions "No unsigned transactions"
|
:no-unsigned-transactions "No unsigned transactions"
|
||||||
|
:unsigned-transaction-expired "Unsigned transaction expired"
|
||||||
:enter-password-transactions {:one "Confirm transaction by entering your password"
|
:enter-password-transactions {:one "Confirm transaction by entering your password"
|
||||||
:other "Confirm transactions by entering your password"}
|
:other "Confirm transactions by entering your password"}
|
||||||
:status "Status"
|
:status "Status"
|
||||||
|
@ -420,7 +421,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;network settings
|
;; network settings
|
||||||
:new-network "New network"
|
:new-network "New network"
|
||||||
:add-network "Add network"
|
:add-network "Add network"
|
||||||
:add-new-network "Add new network"
|
:add-new-network "Add new network"
|
||||||
|
|
|
@ -132,19 +132,20 @@
|
||||||
(fn [[unsigned-transactions transactions current-transaction network]]
|
(fn [[unsigned-transactions transactions current-transaction network]]
|
||||||
(let [transactions (merge transactions unsigned-transactions)
|
(let [transactions (merge transactions unsigned-transactions)
|
||||||
{:keys [gas-used gas-price hash timestamp type] :as transaction} (get transactions current-transaction)]
|
{:keys [gas-used gas-price hash timestamp type] :as transaction} (get transactions current-transaction)]
|
||||||
(merge transaction
|
(when transaction
|
||||||
{:gas-price-eth (money/wei->str :eth gas-price)
|
(merge transaction
|
||||||
:gas-price-gwei (money/wei->str :gwei gas-price)
|
{:gas-price-eth (money/wei->str :eth gas-price)
|
||||||
:date (datetime/timestamp->long-date timestamp)}
|
:gas-price-gwei (money/wei->str :gwei gas-price)
|
||||||
(if (= type :unsigned)
|
:date (datetime/timestamp->long-date timestamp)}
|
||||||
{:block (i18n/label :not-applicable)
|
(if (= type :unsigned)
|
||||||
:cost (i18n/label :not-applicable)
|
{:block (i18n/label :not-applicable)
|
||||||
:gas-limit (i18n/label :not-applicable)
|
:cost (i18n/label :not-applicable)
|
||||||
:gas-used (i18n/label :not-applicable)
|
:gas-limit (i18n/label :not-applicable)
|
||||||
:nonce (i18n/label :not-applicable)
|
:gas-used (i18n/label :not-applicable)
|
||||||
:hash (i18n/label :not-applicable)}
|
:nonce (i18n/label :not-applicable)
|
||||||
{:cost (money/wei->str :eth (money/fee-value gas-used gas-price))
|
:hash (i18n/label :not-applicable)}
|
||||||
:url (transactions/get-transaction-details-url network hash)})))))
|
{:cost (money/wei->str :eth (money/fee-value gas-used gas-price))
|
||||||
|
:url (transactions/get-transaction-details-url network hash)}))))))
|
||||||
|
|
||||||
(reg-sub :wallet.transactions.details/confirmations
|
(reg-sub :wallet.transactions.details/confirmations
|
||||||
:<- [:wallet.transactions/transaction-details]
|
:<- [:wallet.transactions/transaction-details]
|
||||||
|
|
|
@ -250,7 +250,7 @@
|
||||||
{:text (i18n/label :t/open-on-etherscan) :value #(.openURL react/linking url)}])])
|
{:text (i18n/label :t/open-on-etherscan) :value #(.openURL react/linking url)}])])
|
||||||
|
|
||||||
(defview transaction-details []
|
(defview transaction-details []
|
||||||
(letsubs [{:keys [hash url type] :as transactions} [:wallet.transactions/transaction-details]
|
(letsubs [{:keys [hash url type] :as transaction} [:wallet.transactions/transaction-details]
|
||||||
confirmations [:wallet.transactions.details/confirmations]
|
confirmations [:wallet.transactions.details/confirmations]
|
||||||
confirmations-progress [:wallet.transactions.details/confirmations-progress]]
|
confirmations-progress [:wallet.transactions.details/confirmations-progress]]
|
||||||
[react/view {:style styles/flex}
|
[react/view {:style styles/flex}
|
||||||
|
@ -258,9 +258,11 @@
|
||||||
[toolbar/toolbar2 {}
|
[toolbar/toolbar2 {}
|
||||||
toolbar/default-nav-back
|
toolbar/default-nav-back
|
||||||
[toolbar/content-title (i18n/label :t/transaction-details)]
|
[toolbar/content-title (i18n/label :t/transaction-details)]
|
||||||
[toolbar/actions (details-action hash url)]]
|
(when transaction [toolbar/actions (details-action hash url)])]
|
||||||
[react/scroll-view {:style styles/main-container}
|
(if transaction
|
||||||
[details-header transactions]
|
[react/scroll-view {:style styles/main-container}
|
||||||
[details-confirmations confirmations confirmations-progress]
|
[details-header transaction]
|
||||||
[react/view {:style transactions.styles/details-separator}]
|
[details-confirmations confirmations confirmations-progress]
|
||||||
[details-list transactions]]]))
|
[react/view {:style transactions.styles/details-separator}]
|
||||||
|
[details-list transaction]]
|
||||||
|
[empty-text (i18n/label :t/unsigned-transaction-expired)])]))
|
||||||
|
|
Loading…
Reference in New Issue