[#4821] send /send command before after sending transaction (befor pressing "Got it")
This commit is contained in:
parent
32bbf4e533
commit
6028cca377
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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]]
|
||||||
|
|
|
@ -252,7 +252,7 @@
|
||||||
(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]} (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'}
|
||||||
(merge
|
(merge
|
||||||
|
@ -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]}]}))
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue