diff --git a/src/status_im/contexts/wallet/wallet_connect/core.cljs b/src/status_im/contexts/wallet/wallet_connect/core.cljs index f95eb60423..c38811ed37 100644 --- a/src/status_im/contexts/wallet/wallet_connect/core.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/core.cljs @@ -50,7 +50,9 @@ (defn get-session-dapp-metadata [proposal] - (get-in proposal [:params :proposer :metadata])) + (let [metadata (get-in proposal [:params :proposer :metadata]) + origin (get-in proposal [:verifyContext :verified :origin])] + (or metadata {:url origin}))) (defn get-current-request-dapp [request sessions] diff --git a/src/status_im/contexts/wallet/wallet_connect/events.cljs b/src/status_im/contexts/wallet/wallet_connect/events.cljs index 0ad8d9939d..4848591354 100644 --- a/src/status_im/contexts/wallet/wallet_connect/events.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/events.cljs @@ -109,9 +109,12 @@ (if (wallet-connect-core/event-should-be-handled? db event) {:fx [[:dispatch [:wallet-connect/process-session-request event]]]} {:fx [[:dispatch + [:wallet-connect/show-session-networks-unsupported-toast event]] + [:dispatch [:wallet-connect/send-response - {:error (wallet-connect/get-sdk-error - constants/wallet-connect-user-rejected-chains-error-key)}]]]}))) + {:request event + :error (wallet-connect/get-sdk-error + constants/wallet-connect-user-rejected-chains-error-key)}]]]}))) (rf/reg-event-fx :wallet-connect/on-session-delete 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 6dbc959641..f3138e7299 100644 --- a/src/status_im/contexts/wallet/wallet_connect/responding_events.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/responding_events.cljs @@ -115,8 +115,9 @@ (rf/reg-event-fx :wallet-connect/send-response - (fn [{:keys [db]} [{:keys [result error]}]] - (when-let [{:keys [id topic] :as event} (get-in db [:wallet-connect/current-request :event])] + (fn [{:keys [db]} [{:keys [request result error]}]] + (when-let [{:keys [id topic] :as event} (or request + (get-in db [:wallet-connect/current-request :event]))] (let [method (wallet-connect-core/get-request-method event) web3-wallet (get db :wallet-connect/web3-wallet)] {:db (assoc-in db [:wallet-connect/current-request :response-sent?] true)