commit 9efc900851acc71760c66f942163c966aafa87bc
parent 960389166dfaf11a58953417c374970974fe5657
Author: William Casarin <jb55@jb55.com>
Date: Fri, 18 Nov 2022 12:29:07 -0800
trim whitespace when posting
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/damus/Views/PostView.swift b/damus/Views/PostView.swift
@@ -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()