From 0f6aa8d401eb95e0222812763812ec448cb28f96 Mon Sep 17 00:00:00 2001 From: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> Date: Wed, 21 Aug 2024 19:29:21 +0530 Subject: [PATCH] Fix: app upgrade issues in wallet (#21104) This commit: - hides keypairs with empty origin in selection while creating an account - hides remove account button for accounts with empty origin Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> --- .../contexts/wallet/sheets/account_options/view.cljs | 6 ++++-- src/status_im/subs/wallet/wallet.cljs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/status_im/contexts/wallet/sheets/account_options/view.cljs b/src/status_im/contexts/wallet/sheets/account_options/view.cljs index 371419e9ff..2cf4649378 100644 --- a/src/status_im/contexts/wallet/sheets/account_options/view.cljs +++ b/src/status_im/contexts/wallet/sheets/account_options/view.cljs @@ -1,5 +1,6 @@ (ns status-im.contexts.wallet.sheets.account-options.view - (:require [oops.core :as oops] + (:require [clojure.string :as string] + [oops.core :as oops] [quo.core :as quo] [quo.foundations.colors :as colors] quo.theme @@ -33,6 +34,7 @@ [{:keys [theme show-account-selector? options-height]}] (let [{:keys [name color emoji address watch-only? default-account?]} (rf/sub [:wallet/current-viewing-account]) + {:keys [derived-from]} (rf/sub [:wallet/current-viewing-account-keypair]) network-preference-details (rf/sub [:wallet/network-preference-details]) multichain-address (utils/get-multichain-address network-preference-details @@ -89,7 +91,7 @@ #(rf/dispatch [:wallet/share-account {:title share-title :content multichain-address}]) 600))} - (when-not default-account? + (when-not (or default-account? (string/blank? derived-from)) {:add-divider? (not show-account-selector?) :icon :i/delete :accessibility-label :remove-account diff --git a/src/status_im/subs/wallet/wallet.cljs b/src/status_im/subs/wallet/wallet.cljs index d342fcaec6..c5f8ab992b 100644 --- a/src/status_im/subs/wallet/wallet.cljs +++ b/src/status_im/subs/wallet/wallet.cljs @@ -210,7 +210,7 @@ :wallet/fully-operable-keypairs-list :<- [:wallet/keypairs-list] (fn [keypairs] - (filter #(= :fully (:lowest-operability %)) keypairs))) + (filter #(and (= :fully (:lowest-operability %)) (not-empty (:derived-from %))) keypairs))) (rf/reg-sub :wallet/keypair-names