bug #4917 and #4914 - not showing message in chat after wallet send

Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
Goran Jovic 2018-06-23 10:48:08 +02:00 committed by Julien Eluard
parent 5935d29d7d
commit ad1a31073e
No known key found for this signature in database
GPG Key ID: 6FD7DB5437FCBEF6
1 changed files with 9 additions and 3 deletions

View File

@ -277,7 +277,7 @@
::transaction-completed ::transaction-completed
(fn [{db :db now :now} [_ {:keys [id response] :as params} modal?]] (fn [{db :db now :now} [_ {:keys [id response] :as params} modal?]]
(let [{:keys [hash error]} response (let [{:keys [hash error]} response
{:keys [method]} (get-in db [:wallet :send-transaction]) {:keys [method from-chat?]} (get-in db [:wallet :send-transaction])
db' (assoc-in db [:wallet :send-transaction :in-progress?] false)] db' (assoc-in db [:wallet :send-transaction :in-progress?] false)]
(if (and error (string? error) (not (string/blank? error))) ;; ignore error here, error will be handled in :transaction-failed (if (and error (string? error) (not (string/blank? error))) ;; ignore error here, error will be handled in :transaction-failed
{:db db'} {:db db'}
@ -289,11 +289,17 @@
(update-in [:wallet :transactions-unsigned] dissoc id) (update-in [:wallet :transactions-unsigned] dissoc id)
true true
(update-in [:wallet :send-transaction] merge clear-send-properties {:tx-hash hash}))} (update-in [:wallet :send-transaction] merge clear-send-properties {:tx-hash hash}))}
(if modal? (cond
modal?
(cond-> {:dispatch [:navigate-back]} (cond-> {:dispatch [:navigate-back]}
(= method constants/web3-send-transaction) (= method constants/web3-send-transaction)
(assoc :dispatch-later [{:ms 400 :dispatch [:navigate-to-modal :wallet-transaction-sent-modal]}])) (assoc :dispatch-later [{:ms 400 :dispatch [:navigate-to-modal :wallet-transaction-sent-modal]}]))
{:dispatch [:execute-stored-command]}))))))
from-chat?
{:dispatch [:execute-stored-command]}
:else
{:dispatch [:navigation-replace :wallet-transaction-sent]}))))))
(defn on-transactions-modal-completed [raw-results] (defn on-transactions-modal-completed [raw-results]
(let [result (types/json->clj raw-results)] (let [result (types/json->clj raw-results)]