trim whitespace when posting

This commit is contained in:
William Casarin
2022-11-18 12:29:07 -08:00
parent 960389166d
commit 9efc900851

View File

@@ -42,7 +42,8 @@ struct PostView: View {
if replying_to?.known_kind == .chat {
kind = .chat
}
let new_post = NostrPost(content: self.post, references: references, kind: kind)
let content = self.post.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
let new_post = NostrPost(content: content, references: references, kind: kind)
NotificationCenter.default.post(name: .post, object: NostrPostResult.post(new_post))
dismiss()