diff --git a/src/status_im/contexts/wallet/wallet_connect/events.cljs b/src/status_im/contexts/wallet/wallet_connect/events.cljs index 8dba642f7f..22c6e55f3f 100644 --- a/src/status_im/contexts/wallet/wallet_connect/events.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/events.cljs @@ -146,24 +146,25 @@ :events constants/wallet-connect-supported-events :accounts accounts}})] {:fx [[:effects.wallet-connect/approve-session - {:web3-wallet web3-wallet - :proposal current-proposal + {:web3-wallet web3-wallet + :proposal current-proposal :supported-namespaces supported-namespaces - :on-success (fn [] - (log/info "Wallet Connect session approved") - (let [metadata (-> current-proposal :params :proposer :metadata)] - (rf/dispatch [:wallet-connect/reset-current-session-proposal]) - (rf/dispatch [:wallet-connect/persist-session - {:id (:id current-proposal) - :dapp-name (:name metadata) - :dapp-url (:url metadata) - :session-info current-proposal}]))) - :on-fail (fn [error] - (log/error "Wallet Connect session approval failed" - {:error error - :event :wallet-connect/approve-session}) - (rf/dispatch - [:wallet-connect/reset-current-session-proposal]))}] + :on-success (fn [] + (log/info "Wallet Connect session approved") + (let [metadata (-> current-proposal :params :proposer :metadata)] + (rf/dispatch [:wallet-connect/reset-current-session-proposal]) + (rf/dispatch [:wallet-connect/persist-session + {:id (:id current-proposal) + :dapp-name (:name metadata) + :dapp-url (:url metadata) + :session-info current-proposal}]))) + :on-fail (fn [error] + (log/error "Wallet Connect session approval failed" + {:error error + :event :wallet-connect/approve-session}) + (rf/dispatch + [:wallet-connect/reset-current-session-proposal]))}] + [:dispatch [:dismiss-modal :screen/wallet.wallet-connect-session-proposal]]]}))) (rf/reg-event-fx @@ -192,7 +193,8 @@ {:version version})}]]]} :else - {:fx [[:dispatch [:wallet-connect/pair scanned-text]]]})))) + {:fx [[:dispatch [:wallet-connect/pair scanned-text]] + [:dispatch [:dismiss-modal :screen/wallet.wallet-connect-session-proposal]]]})))) (rf/reg-event-fx :wallet-connect/persist-session