Fix a few more hitches

This commit is contained in:
William Casarin
2023-04-12 18:22:16 -07:00
parent e9f71ed07c
commit 54c8958250
3 changed files with 51 additions and 46 deletions

View File

@@ -82,7 +82,7 @@ class NostrEvent: Codable, Identifiable, CustomStringConvertible, Equatable, Has
}
var too_big: Bool {
return self.content.count > 16000
return self.content.underestimatedCount > 16000
}
var should_show_event: Bool {

View File

@@ -89,7 +89,7 @@ final class RelayConnection: WebSocketDelegate {
self.isConnected = false
case .text(let txt):
if txt.count > 2000 {
if txt.underestimatedCount > 2000 {
DispatchQueue.global(qos: .default).async {
if let ev = decode_nostr_event(txt: txt) {
DispatchQueue.main.async {