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>
This commit is contained in:
Mohamed Javid 2024-08-21 19:29:21 +05:30 committed by GitHub
parent 32ddf81a5e
commit 0f6aa8d401
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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