Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHeaps committed Jan 19, 2024
1 parent d05c094 commit 6824b33
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
18 changes: 0 additions & 18 deletions Sources/BraveWallet/Crypto/Accounts/AccountsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -346,21 +346,3 @@ private struct AccountCardView: View {
.clipShape(RoundedRectangle(cornerRadius: 8))
}
}

private extension BraveWallet.AccountInfo {
/// String to display what this account supports, ex. `"Ethereum + EVM Chains"`.
var accountSupportDisplayString: String {
switch coin {
case .eth:
return Strings.Wallet.ethAccountDescription
case .sol:
return Strings.Wallet.solAccountDescription
case .fil:
return Strings.Wallet.filAccountDescription
case .btc, .zec:
return ""
@unknown default:
return ""
}
}
}
3 changes: 2 additions & 1 deletion Sources/BraveWallet/Crypto/Stores/AccountsStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AccountsStore: ObservableObject, WalletObserverStore {
private var walletServiceObserver: WalletServiceObserver?

var isObserving: Bool {
keyringServiceObserver != nil
keyringServiceObserver != nil && walletServiceObserver != nil
}

init(
Expand Down Expand Up @@ -85,6 +85,7 @@ class AccountsStore: ObservableObject, WalletObserverStore {

func tearDown() {
keyringServiceObserver = nil
walletServiceObserver = nil
}

func update() {
Expand Down
18 changes: 18 additions & 0 deletions Sources/BraveWallet/Extensions/BraveWalletExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,24 @@ extension BraveWallet.AccountId {
}
}

extension BraveWallet.AccountInfo {
/// String to display what this account supports, ex. `"Ethereum + EVM Chains"`.
var accountSupportDisplayString: String {
switch coin {
case .eth:
return Strings.Wallet.ethAccountDescription
case .sol:
return Strings.Wallet.solAccountDescription
case .fil:
return Strings.Wallet.filAccountDescription
case .btc, .zec:
return ""
@unknown default:
return ""
}
}
}

extension BraveWallet.CoinType {
public var keyringIds: [BraveWallet.KeyringId] {
switch self {
Expand Down

0 comments on commit 6824b33

Please sign in to comment.