Cleaning up mod action line.

This commit is contained in:
Dessalines 2024-02-29 11:00:14 -05:00
parent 40e966246f
commit e42b75f6dc

View file

@ -212,9 +212,8 @@ impl Object for ApubPost {
let first_attachment = page.attachment.first();
let form = if !page.is_mod_action(context).await? {
let first_attachment_url = first_attachment.cloned().map(Attachment::url);
let url = if first_attachment.is_some() {
first_attachment_url
let url = if let Some(attachment) = first_attachment.cloned() {
Some(attachment.url())
} else if page.kind == PageType::Video {
// we cant display videos directly, so insert a link to external video page
Some(page.id.inner().clone())