[#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) (#{:home :wallet :my-profile} view-id)
(do (.exitApp react/back-handler)) (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)) (< 1 (count @stack))
(do (dispatch [:navigate-back]) true) (do (dispatch [:navigate-back]) true)

View File

@ -305,6 +305,13 @@
(models.message/group-messages current-chat-id new-messages) (models.message/group-messages current-chat-id new-messages)
(mark-messages-seen current-chat-id)))))) (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 (handlers/register-handler-fx
:execute-stored-command-and-return-to-chat :execute-stored-command-and-return-to-chat
(fn [cofx [_ chat-id]] (fn [cofx [_ chat-id]]

View File

@ -267,7 +267,7 @@
(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 [:navigation-replace :wallet-transaction-sent]})))))) {:dispatch [:execute-stored-command]}))))))
(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)]
@ -409,7 +409,5 @@
(handlers/register-handler-fx (handlers/register-handler-fx
:close-transaction-sent-screen :close-transaction-sent-screen
(fn [{:keys [db]} [_ chat-id]] (fn [{:keys [db]} [_ chat-id]]
{:dispatch (condp = (second (:navigation-stack db)) {:dispatch [:navigate-back]
:chat [:execute-stored-command-and-return-to-chat chat-id]
[:navigate-back])
:dispatch-later [{:ms 400 :dispatch [:check-transactions-queue]}]})) :dispatch-later [{:ms 400 :dispatch [:check-transactions-queue]}]}))

View File

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