diff --git a/src/status_im/ui/screens/wallet/send/events.cljs b/src/status_im/ui/screens/wallet/send/events.cljs index 1203ec6f0b..160288c119 100644 --- a/src/status_im/ui/screens/wallet/send/events.cljs +++ b/src/status_im/ui/screens/wallet/send/events.cljs @@ -20,10 +20,9 @@ ::send-transaction (fn [{:keys [web3] :as params}] (when web3 - (.sendTransaction - (.-eth web3) - (clj->js (select-keys params [:from :to :value])) - #())))) + (.sendTransaction (.-eth web3) + (clj->js (select-keys params [:from :to :value])) + #())))) (re-frame/reg-fx ::show-transaction-moved @@ -75,7 +74,8 @@ {:db (-> db' (update-in [:wallet :transactions-unsigned] dissoc id) (update-in [:wallet :send-transaction] merge clear-send-properties)) - :dispatch [:navigate-back]})))) + :dispatch-n [[:navigate-back] + [:navigate-to :wallet-transaction-sent]]})))) (defn on-transactions-modal-completed [raw-results] (let [results (:results (types/json->clj raw-results))] diff --git a/src/status_im/ui/screens/wallet/send/subs.cljs b/src/status_im/ui/screens/wallet/send/subs.cljs index 5345785ea5..5f13948916 100644 --- a/src/status_im/ui/screens/wallet/send/subs.cljs +++ b/src/status_im/ui/screens/wallet/send/subs.cljs @@ -4,6 +4,13 @@ [status-im.utils.money :as money] [status-im.utils.hex :as utils.hex])) +(re-frame/reg-sub :wallet.sent/close-transaction-screen-event + :<- [:get :navigation-stack] + (fn [navigation-stack] + (case (second navigation-stack) + :wallet-send-transaction [:navigate-to-clean :wallet] + [:navigate-back]))) + (re-frame/reg-sub ::send-transaction :<- [:wallet] (fn [wallet] diff --git a/src/status_im/ui/screens/wallet/send/transaction_sent/views.cljs b/src/status_im/ui/screens/wallet/send/transaction_sent/views.cljs index 5f22df5482..c852ae8bb8 100644 --- a/src/status_im/ui/screens/wallet/send/transaction_sent/views.cljs +++ b/src/status_im/ui/screens/wallet/send/transaction_sent/views.cljs @@ -12,27 +12,28 @@ [status-im.utils.platform :as platform])) (defview transaction-sent [] - [react/view wallet.styles/wallet-modal-container - [status-bar/status-bar {:type :transparent}] - [react/view styles/transaction-sent-container - [react/view styles/ok-icon-container - [vi/icon :icons/ok {:color components.styles/color-blue4}]] - [react/text {:style styles/transaction-sent - :font (if platform/android? :medium :default)} - (i18n/label :t/transaction-sent)] - [react/view styles/gap] - [react/text {:style styles/transaction-sent-description} (i18n/label :t/transaction-description)]] - [react/view components.styles/flex] - [react/touchable-highlight {:on-press #()}; TODO (andrey) #(re-frame/dispatch [:navigate-to-clean :wallet-transaction-details])} - [react/view styles/transaction-details-container - [react/text {:style styles/transaction-details - :font (if platform/android? :medium :default) - :uppercase? (get-in platform/platform-specific [:uppercase?])} - (i18n/label :t/view-transaction-details)]]] - [components/separator] - [react/touchable-highlight {:on-press #(re-frame/dispatch [:navigate-to-clean :wallet])} - [react/view styles/got-it-container - [react/text {:style styles/got-it - :font (if platform/android? :medium :default) - :uppercase? (get-in platform/platform-specific [:uppercase?])} - (i18n/label :t/got-it)]]]]) \ No newline at end of file + (letsubs [close-transaction-screen-event [:wallet.sent/close-transaction-screen-event]] + [react/view wallet.styles/wallet-modal-container + [status-bar/status-bar {:type :transparent}] + [react/view styles/transaction-sent-container + [react/view styles/ok-icon-container + [vi/icon :icons/ok {:color components.styles/color-blue4}]] + [react/text {:style styles/transaction-sent + :font (if platform/android? :medium :default)} + (i18n/label :t/transaction-sent)] + [react/view styles/gap] + [react/text {:style styles/transaction-sent-description} (i18n/label :t/transaction-description)]] + [react/view components.styles/flex] + [react/touchable-highlight {:on-press #()}; TODO (andrey) #(re-frame/dispatch [:navigate-to-clean :wallet-transaction-details])} + [react/view styles/transaction-details-container + [react/text {:style styles/transaction-details + :font (if platform/android? :medium :default) + :uppercase? (get-in platform/platform-specific [:uppercase?])} + (i18n/label :t/view-transaction-details)]]] + [components/separator] + [react/touchable-highlight {:on-press #(re-frame/dispatch close-transaction-screen-event)} + [react/view styles/got-it-container + [react/text {:style styles/got-it + :font (if platform/android? :medium :default) + :uppercase? (get-in platform/platform-specific [:uppercase?])} + (i18n/label :t/got-it)]]]])) diff --git a/src/status_im/ui/screens/wallet/send/views.cljs b/src/status_im/ui/screens/wallet/send/views.cljs index 03f0a34003..ed46788444 100644 --- a/src/status_im/ui/screens/wallet/send/views.cljs +++ b/src/status_im/ui/screens/wallet/send/views.cljs @@ -26,11 +26,14 @@ act/default-handler))] [toolbar/content-title {:color :white} (i18n/label :t/send-transaction)]]) -(defn sign-later [] +(defn sign-later-popup + [from-chat?] (utils/show-question (i18n/label :t/sign-later-title) (i18n/label :t/sign-later-text) - #(re-frame/dispatch [:wallet/sign-transaction true]))) + #(re-frame/dispatch (if from-chat? + [:navigate-back] + [:wallet/sign-transaction true])))) (defview sign-panel [] (letsubs [account [:get-current-account] @@ -136,7 +139,7 @@ #(re-frame/dispatch [:wallet/discard-transaction]) #(re-frame/dispatch [:wallet/sign-transaction]) in-progress?] - [sign-buttons amount-error to-address amount sufficient-funds? sign-later]) + [sign-buttons amount-error to-address amount sufficient-funds? #(sign-later-popup false)]) (when signing? [sign-panel])] (when in-progress? [react/view send.styles/processing-view])]))) @@ -177,7 +180,9 @@ #(re-frame/dispatch [:wallet/cancel-signing-modal]) #(re-frame/dispatch [:wallet/sign-transaction-modal]) in-progress?] - [sign-buttons amount-error to amount sufficient-funds? #(re-frame/dispatch [:navigate-back])]) + [sign-buttons amount-error to amount sufficient-funds? (if from-chat? + #(sign-later-popup true) + #(re-frame/dispatch [:navigate-back]))]) (when signing? [sign-panel]) (when in-progress? [react/view send.styles/processing-view])]])