[#4821] send /send command before after sending transaction (befor pressing "Got it")

This commit is contained in:
Roman Volosovskyi 2018-06-19 16:07:18 +03:00
parent 32bbf4e533
commit 6028cca377
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
4 changed files with 11 additions and 9 deletions

View File

@ -31,9 +31,6 @@
(#{:home :wallet :my-profile} view-id)
(do (.exitApp react/back-handler))
(= :wallet-transaction-sent @view-id)
(do (dispatch [:execute-stored-command-and-return-to-chat @chat-id]) true)
(< 1 (count @stack))
(do (dispatch [:navigate-back]) true)

View File

@ -305,6 +305,13 @@
(models.message/group-messages current-chat-id new-messages)
(mark-messages-seen current-chat-id))))))
(handlers/register-handler-fx
:execute-stored-command
(fn [cofx _]
(handlers-macro/merge-fx cofx
(events.commands/execute-stored-command)
(navigation/replace-view :wallet-transaction-sent))))
(handlers/register-handler-fx
:execute-stored-command-and-return-to-chat
(fn [cofx [_ chat-id]]

View File

@ -252,7 +252,7 @@
(fn [{db :db now :now} [_ {:keys [id response] :as params} modal?]]
(let [{:keys [hash error]} response
{:keys [method]} (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
{:db db'}
(merge
@ -267,7 +267,7 @@
(cond-> {:dispatch [:navigate-back]}
(= method constants/web3-send-transaction)
(assoc :dispatch-later [{:ms 400 :dispatch [:navigate-to-modal :wallet-transaction-sent-modal]}]))
{:dispatch [:navigation-replace :wallet-transaction-sent]}))))))
{:dispatch [:execute-stored-command]}))))))
(defn on-transactions-modal-completed [raw-results]
(let [result (types/json->clj raw-results)]
@ -409,7 +409,5 @@
(handlers/register-handler-fx
:close-transaction-sent-screen
(fn [{:keys [db]} [_ chat-id]]
{:dispatch (condp = (second (:navigation-stack db))
:chat [:execute-stored-command-and-return-to-chat chat-id]
[:navigate-back])
{:dispatch [:navigate-back]
:dispatch-later [{:ms 400 :dispatch [:check-transactions-queue]}]}))

View File

@ -145,7 +145,7 @@
:trigger [:navigate-to-clean :wallet]
:properties {:target :wallet-got-it}}
{:label "Tap"
:trigger [:navigation-replace :wallet-transaction-sent]
:trigger [:execute-stored-command]
:properties {:target :wallet-transaction-sent}}
;;Profile