Browse Source

clean up dead code

post-button-style
Benjamin Hakes 2 years ago
parent
commit
79c42544d9
No known key found for this signature in database GPG Key ID: 303A85CC0ACDB796
  1. 56
      damus/Models/UserSettingsStore.swift
  2. 5
      damus/Views/ConfigView.swift

56
damus/Models/UserSettingsStore.swift

@ -10,7 +10,7 @@ import Foundation
class UserSettingsStore: ObservableObject {
@Published var defaultWallet: Wallet {
didSet {
UserDefaults.standard.set(defaultWallet.rawValue, forKey: "systemdefaultwallet")
UserDefaults.standard.set(defaultWallet.rawValue, forKey: "defaultwallet")
}
}
@ -25,57 +25,3 @@ class UserSettingsStore: ObservableObject {
self.showWalletSelector = UserDefaults.standard.object(forKey: "showwalletselector") as? Bool ?? true
}
}
//
//func get_wallet_list() -> [WalletItem] {
// let values: [String] = Wallet.allCases.map { $0.rawValue }
//
// var walletList: [WalletItem] = []
//
// for value in values {
// let data = value.data(using: .utf8)!
// do {
// let wallet = try JSONDecoder().decode(WalletItem.self, from: data)
// walletList.append(wallet)
// } catch {
// return []
// }
// }
// return walletList
//}
//func get_wallet_tag(_ tag: String) -> Wallet {
// switch tag {
// case "defaultwallet":
// return Wallet.defaultwallet
// case "strike":
// return Wallet.strike
// case "cashapp":
// return Wallet.cashapp
// case "muun":
// return Wallet.muun
// case "bluewallet":
// return Wallet.bluewallet
// case "walletofsatoshi":
// return Wallet.walletofsatoshi
// case "zebedee":
// return Wallet.zebedee
// case "zeusln":
// return Wallet.zeusln
// case "lnlink":
// return Wallet.lnlink
// case "phoenix":
// return Wallet.phoenix
// default:
// return Wallet.defaultwallet
// }
//}
//func get_default_wallet(_ us: String) -> WalletItem {
// let data = us.data(using: .utf8)!
// do {
// return try JSONDecoder().decode(WalletItem.self, from: data)
// } catch {
// return get_wallet_list()[0]
// }
//
//}

5
damus/Views/ConfigView.swift

@ -83,8 +83,9 @@ struct ConfigView: View {
Section("Wallet Selector") {
Toggle("Show wallet selector", isOn: $user_settings.showWalletSelector).toggleStyle(.switch)
Picker(selection: $user_settings.defaultWallet, label: Text("Select default wallet"), content: {
List($walletModels) { $wallet in
Picker(selection: $user_settings.defaultWallet,
label: Text("Select default wallet"), content: {
ForEach(walletModels) { wallet in
Text(wallet.displayName)
.tag(wallet.tag)
}

Loading…
Cancel
Save