|
51 | 51 |
|
52 | 52 | (rf/reg-event-fx
|
53 | 53 | :wallet/select-send-address
|
54 |
| - (fn [{:keys [db]} [{:keys [address token? recipient stack-id]}]] |
| 54 | + (fn [{:keys [db]} [{:keys [address recipient stack-id start-flow?]}]] |
55 | 55 | (let [[prefix to-address] (utils/split-prefix-and-address address)
|
56 | 56 | test-net? (get-in db [:profile/profile :test-networks-enabled?])
|
57 | 57 | goerli-enabled? (get-in db [:profile/profile :is-goerli-enabled?])
|
|
65 | 65 | (assoc-in [:wallet :ui :send :address-prefix] prefix)
|
66 | 66 | (assoc-in [:wallet :ui :send :selected-networks] selected-networks))
|
67 | 67 | :fx [[:dispatch
|
68 |
| - [:navigate-to-within-stack |
69 |
| - (if token? |
70 |
| - [:screen/wallet.send-input-amount stack-id] |
71 |
| - [:screen/wallet.select-asset stack-id])]]]}))) |
| 68 | + [:wallet/wizard-navigate-forward |
| 69 | + {:current-screen stack-id |
| 70 | + :start-flow? start-flow? |
| 71 | + :flow-id :wallet-flow}]]]}))) |
72 | 72 |
|
73 | 73 | (rf/reg-event-fx
|
74 | 74 | :wallet/update-receiver-networks
|
75 | 75 | (fn [{:keys [db]} [selected-networks]]
|
76 | 76 | {:db (assoc-in db [:wallet :ui :send :selected-networks] selected-networks)}))
|
77 | 77 |
|
78 | 78 | (rf/reg-event-fx :wallet/send-select-token
|
79 |
| - (fn [{:keys [db]} [{:keys [token stack-id]}]] |
| 79 | + (fn [{:keys [db]} [{:keys [token stack-id start-flow?]}]] |
80 | 80 | {:db (-> db
|
81 | 81 | (update-in [:wallet :ui :send] dissoc :collectible)
|
82 | 82 | (assoc-in [:wallet :ui :send :token] token))
|
83 | 83 | :fx [[:dispatch [:wallet/clean-suggested-routes]]
|
84 |
| - [:dispatch [:navigate-to-within-stack [:screen/wallet.send-input-amount stack-id]]]]})) |
85 |
| - |
86 |
| -(rf/reg-event-fx |
87 |
| - :wallet/send-select-token-drawer |
88 |
| - (fn [{:keys [db]} [{:keys [token]}]] |
89 |
| - {:db (assoc-in db [:wallet :ui :send :token] token)})) |
| 84 | + [:dispatch |
| 85 | + [:wallet/wizard-navigate-forward |
| 86 | + {:current-screen stack-id |
| 87 | + :start-flow? start-flow? |
| 88 | + :flow-id :wallet-flow}]]]})) |
90 | 89 |
|
91 | 90 | (rf/reg-event-fx :wallet/clean-selected-token
|
92 | 91 | (fn [{:keys [db]}]
|
|
113 | 112 | [:navigate-to-within-stack [:screen/wallet.transaction-confirmation stack-id]]]}))
|
114 | 113 |
|
115 | 114 | (rf/reg-event-fx :wallet/send-select-amount
|
116 |
| - (fn [{:keys [db]} [{:keys [amount stack-id]}]] |
| 115 | + (fn [{:keys [db]} [{:keys [amount stack-id start-flow?]}]] |
117 | 116 | {:db (assoc-in db [:wallet :ui :send :amount] amount)
|
118 |
| - :fx [[:dispatch [:navigate-to-within-stack [:screen/wallet.transaction-confirmation stack-id]]]]})) |
| 117 | + :fx [[:dispatch |
| 118 | + [:wallet/wizard-navigate-forward |
| 119 | + {:current-screen stack-id |
| 120 | + :start-flow? start-flow? |
| 121 | + :flow-id :wallet-flow}]]]})) |
119 | 122 |
|
120 | 123 | (rf/reg-event-fx :wallet/get-suggested-routes
|
121 | 124 | (fn [{:keys [db now]} [{:keys [amount]}]]
|
|
184 | 187 | (assoc-in [:wallet :transactions] transaction-details)
|
185 | 188 | (assoc-in [:wallet :ui :send :transaction-ids] transaction-ids))
|
186 | 189 | :fx [[:dispatch
|
187 |
| - [:navigate-to-within-stack |
188 |
| - [:screen/wallet.transaction-progress :screen/wallet.transaction-confirmation]]]]}))) |
| 190 | + [:wallet/wizard-navigate-forward |
| 191 | + {:current-screen :screen/wallet.transaction-confirmation |
| 192 | + :flow-id :wallet-flow}]]]}))) |
189 | 193 |
|
190 | 194 | (rf/reg-event-fx :wallet/close-transaction-progress-page
|
191 | 195 | (fn [_]
|
192 |
| - {:fx [[:dispatch [:dismiss-modal :screen/wallet.transaction-progress]]]})) |
| 196 | + {:fx [[:dispatch [:wallet/clean-scanned-address]] |
| 197 | + [:dispatch [:wallet/clean-local-suggestions]] |
| 198 | + [:dispatch [:wallet/clean-send-address]] |
| 199 | + [:dispatch [:wallet/select-address-tab nil]] |
| 200 | + [:dispatch [:dismiss-modal :screen/wallet.transaction-progress]]]})) |
193 | 201 |
|
194 | 202 | (defn- transaction-data
|
195 | 203 | [{:keys [from-address to-address token-address route data eth-transfer?]}]
|
|
331 | 339 | :params request-params
|
332 | 340 | :on-success (fn [result]
|
333 | 341 | (rf/dispatch [:hide-bottom-sheet])
|
334 |
| - (rf/dispatch [:wallet/add-authorized-transaction result]) |
335 |
| - (rf/dispatch [:wallet/clean-scanned-address]) |
336 |
| - (rf/dispatch [:wallet/clean-local-suggestions]) |
337 |
| - (rf/dispatch [:wallet/clean-send-address]) |
338 |
| - (rf/dispatch [:wallet/select-address-tab nil])) |
| 342 | + (rf/dispatch [:wallet/add-authorized-transaction result])) |
339 | 343 | :on-error (fn [error]
|
340 | 344 | (log/error "failed to send transaction"
|
341 | 345 | {:event :wallet/send-transaction
|
|
0 commit comments