From 823a683dab18612713fe1eefa38d1dfedbcf1374 Mon Sep 17 00:00:00 2001 From: alwx Date: Wed, 24 Jul 2024 10:32:50 +0200 Subject: [PATCH] Attempt to fix "Undefined is not a function" when declining connection request --- .../contexts/wallet/wallet_connect/responding_events.cljs | 5 +++-- .../wallet/wallet_connect/session_proposal/view.cljs | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/status_im/contexts/wallet/wallet_connect/responding_events.cljs b/src/status_im/contexts/wallet/wallet_connect/responding_events.cljs index 16c2c9a6e7..53270b3937 100644 --- a/src/status_im/contexts/wallet/wallet_connect/responding_events.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/responding_events.cljs @@ -131,12 +131,13 @@ (fn [{:keys [db]} _] (let [web3-wallet (get db :wallet-connect/web3-wallet) current-proposal (get-in db [:wallet-connect/current-proposal :request])] - {:fx [[:effects.wallet-connect/reject-session-proposal + {:db (dissoc db :wallet-connect/current-proposal) + :fx [[:effects.wallet-connect/reject-session-proposal {:web3-wallet web3-wallet :proposal current-proposal :on-success #(log/info "Wallet Connect session proposal rejected") :on-error #(log/error "Wallet Connect unable to reject session proposal")}] - [:dispatch [:wallet-connect/reset-current-session-proposal]]]}))) + [:dispatch [:dismiss-modal :screen/wallet.wallet-connect-session-proposal]]]}))) ;; NOTE: Currently we only reject a session if the user rejected it ;; But this needs to be solidified to ensure other cases: diff --git a/src/status_im/contexts/wallet/wallet_connect/session_proposal/view.cljs b/src/status_im/contexts/wallet/wallet_connect/session_proposal/view.cljs index 8e321bc067..16e19ccf56 100644 --- a/src/status_im/contexts/wallet/wallet_connect/session_proposal/view.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/session_proposal/view.cljs @@ -149,7 +149,6 @@ :button-two-props {:type :grey :accessibility-label :wc-deny-connection :on-press (fn [] - (rf/dispatch [:navigate-back]) (rf/dispatch [:wallet-connect/reject-session-proposal]))} :button-one-label (i18n/label :t/connect)