Only show longform preview in notifications
Changelog-Fixed: Show longform previews in notifications instead of the entire post
This commit is contained in:
@@ -21,19 +21,24 @@ struct EventBody: View {
|
||||
self.options = options
|
||||
self.should_show_img = should_show_img ?? should_show_images(settings: damus_state.settings, contacts: damus_state.contacts, ev: event, our_pubkey: damus_state.pubkey)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
if event.known_kind == .longform {
|
||||
let longform = LongformEvent.parse(from: event)
|
||||
|
||||
Text(longform.title ?? "Untitled")
|
||||
.font(.title)
|
||||
.padding(.horizontal)
|
||||
}
|
||||
|
||||
|
||||
var note_content: some View {
|
||||
NoteContentView(damus_state: damus_state, event: event, show_images: should_show_img, size: size, options: options)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
if event.known_kind == .longform {
|
||||
LongformPreviewBody(state: damus_state, ev: event, options: options)
|
||||
|
||||
// truncated longform bodies are just the preview
|
||||
if !options.contains(.truncate_content) {
|
||||
note_content
|
||||
}
|
||||
} else {
|
||||
note_content
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct EventBody_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user