Skip to content

Commit

Permalink
[#21853] fix: remove redundant check for web3 object
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri committed Jan 9, 2025
1 parent c7262f1 commit e336c80
Showing 1 changed file with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,22 @@
(get-in db [:wallet-connect/current-request :event]))]
(let [method (data-store/get-request-method event)
web3-wallet (get db :wallet-connect/web3-wallet)]
(when web3-wallet
{:db (assoc-in db [:wallet-connect/current-request :response-sent?] true)
:fx [[:effects.wallet-connect/respond-session-request
{:web3-wallet web3-wallet
:topic topic
:id id
:result result
:error error
:on-error (fn [error]
(log/error "Failed to send Wallet Connect response"
{:error error
:method method
:event :wallet-connect/send-response
:wallet-connect-event event}))
:on-success (fn []
(rf/dispatch [:wallet-connect/redirect-to-dapp])
(log/info "Successfully sent Wallet Connect response to dApp"))}]]})))))
{:db (assoc-in db [:wallet-connect/current-request :response-sent?] true)
:fx [[:effects.wallet-connect/respond-session-request
{:web3-wallet web3-wallet
:topic topic
:id id
:result result
:error error
:on-error (fn [error]
(log/error "Failed to send Wallet Connect response"
{:error error
:method method
:event :wallet-connect/send-response
:wallet-connect-event event}))
:on-success (fn []
(rf/dispatch [:wallet-connect/redirect-to-dapp])
(log/info "Successfully sent Wallet Connect response to dApp"))}]]}))))

(rf/reg-event-fx
:wallet-connect/redirect-to-dapp
Expand Down

0 comments on commit e336c80

Please sign in to comment.