Skip to content

Commit

Permalink
[#22206] fix: swap proposal keep sending update either after clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri committed Feb 28, 2025
1 parent 376493b commit d861934
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/status_im/contexts/wallet/swap/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,13 @@

(rf/reg-event-fx :wallet/stop-get-swap-proposal
(fn [{:keys [db]}]
(let [route-request-ongoing? (some? (get-in db [:wallet :ui :swap :last-request-uuid]))]
(when route-request-ongoing?
{:db (update-in db [:wallet :ui :swap] dissoc :last-request-uuid)
:json-rpc/call [{:method "wallet_stopSuggestedRoutesAsyncCalculation"
:params []
:on-error (fn [error]
(log/error "failed to stop fetching swap proposals"
{:event :wallet/stop-get-swap-proposal
:error error}))}]}))))
{:db (update-in db [:wallet :ui :swap] dissoc :last-request-uuid)
:json-rpc/call [{:method "wallet_stopSuggestedRoutesAsyncCalculation"
:params []
:on-error (fn [error]
(log/error "failed to stop fetching swap proposals"
{:event :wallet/stop-get-swap-proposal
:error error}))}]}))

(rf/reg-event-fx
:wallet/clean-swap-proposal
Expand Down

0 comments on commit d861934

Please sign in to comment.