commit 5b901656f3db4762aa1021250fa0b0dfdfd3963f
parent 36acdf420ed0b9d49d55d9318e3adf9ab0ddfd27
Author: William Casarin <jb55@jb55.com>
Date: Sun, 10 Sep 2023 16:11:39 -0700
perf: fix weird lag when switching timelines
Diffstat:
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/damus/Util/Keys.swift b/damus/Util/Keys.swift
@@ -30,8 +30,8 @@ struct FullKeypair: Equatable {
struct Keypair {
let pubkey: Pubkey
let privkey: Privkey?
- let pubkey_bech32: String
- let privkey_bech32: String?
+ //let pubkey_bech32: String
+ //let privkey_bech32: String?
static var empty: Keypair {
Keypair(pubkey: .empty, privkey: nil)
@@ -52,8 +52,8 @@ struct Keypair {
init(pubkey: Pubkey, privkey: Privkey?) {
self.pubkey = pubkey
self.privkey = privkey
- self.pubkey_bech32 = pubkey.npub
- self.privkey_bech32 = privkey?.nsec
+ //self.pubkey_bech32 = pubkey.npub
+ //self.privkey_bech32 = privkey?.nsec
}
}
diff --git a/damus/Views/Settings/KeySettingsView.swift b/damus/Views/Settings/KeySettingsView.swift
@@ -20,7 +20,7 @@ struct KeySettingsView: View {
@Environment(\.dismiss) var dismiss
init(keypair: Keypair) {
- _privkey = State(initialValue: keypair.privkey_bech32 ?? "")
+ _privkey = State(initialValue: keypair.privkey?.nsec ?? "")
self.keypair = keypair
}
@@ -40,7 +40,7 @@ struct KeySettingsView: View {
func CopyButton(is_pk: Bool) -> some View {
return Button(action: {
let copyKey = {
- UIPasteboard.general.string = is_pk ? self.keypair.pubkey_bech32 : self.privkey
+ UIPasteboard.general.string = is_pk ? self.keypair.pubkey.npub : self.privkey
self.privkey_copied = !is_pk
self.pubkey_copied = is_pk
@@ -74,14 +74,14 @@ struct KeySettingsView: View {
Form {
Section(NSLocalizedString("Public Account ID", comment: "Section title for the user's public account ID.")) {
HStack {
- Text(keypair.pubkey_bech32)
-
+ Text(keypair.pubkey.npub)
+
CopyButton(is_pk: true)
}
.clipShape(RoundedRectangle(cornerRadius: 5))
}
- if let sec = keypair.privkey_bech32 {
+ if let sec = keypair.privkey?.nsec {
Section(NSLocalizedString("Secret Account Login Key", comment: "Section title for user's secret account login key.")) {
HStack {
if show_privkey == false || !has_authenticated_locally {