Compare commits
1 Commits
master
...
nprofile-q
| Author | SHA1 | Date | |
|---|---|---|---|
|
8f6ea4d8dd
|
@@ -440,23 +440,17 @@ fileprivate struct QRCameraView<Content: View>: View {
|
|||||||
str.removeFirst("nostr:".count)
|
str.removeFirst("nostr:".count)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let decoded = hex_decode(str),
|
let bech32 = Bech32Object.parse(str)
|
||||||
str.count == 64
|
switch bech32 {
|
||||||
{
|
case .nprofile(let nprofile):
|
||||||
self.pubkey = Pubkey(Data(decoded))
|
self.pubkey = nprofile.author
|
||||||
return
|
case .npub(let pubkey):
|
||||||
}
|
self.pubkey = pubkey
|
||||||
|
default:
|
||||||
if str.starts(with: "npub"),
|
|
||||||
let b32 = try? bech32_decode(str)
|
|
||||||
{
|
|
||||||
self.pubkey = Pubkey(b32.data)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user