diff --git a/src/status_im/android/core.cljs b/src/status_im/android/core.cljs index 0ee9e7f607..0dde3c7f11 100644 --- a/src/status_im/android/core.cljs +++ b/src/status_im/android/core.cljs @@ -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) diff --git a/src/status_im/chat/events.cljs b/src/status_im/chat/events.cljs index 2160d006bb..9e683a36e0 100644 --- a/src/status_im/chat/events.cljs +++ b/src/status_im/chat/events.cljs @@ -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]] diff --git a/src/status_im/ui/screens/wallet/send/events.cljs b/src/status_im/ui/screens/wallet/send/events.cljs index 49af871685..28de52986b 100644 --- a/src/status_im/ui/screens/wallet/send/events.cljs +++ b/src/status_im/ui/screens/wallet/send/events.cljs @@ -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]}]})) diff --git a/src/status_im/utils/mixpanel_events.cljs b/src/status_im/utils/mixpanel_events.cljs index a55e73303c..9143865682 100644 --- a/src/status_im/utils/mixpanel_events.cljs +++ b/src/status_im/utils/mixpanel_events.cljs @@ -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