Merge pull request #2 from nbenaglia/feature/nip_36_approve_check

Move check for approve_content_warning
This commit is contained in:
nico.benaz 2023-08-20 00:03:28 +02:00 committed by GitHub
commit 1294036699
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -904,7 +904,7 @@ fn render_content(
} else if app.render_qr == Some(event.id) { } else if app.render_qr == Some(event.id) {
app.render_qr(ui, ctx, "feedqr", event.content.trim()); app.render_qr(ui, ctx, "feedqr", event.content.trim());
// FIXME should this be the unmodified content (event.content)? // FIXME should this be the unmodified content (event.content)?
} else if event.content_warning().is_some() && !app.approved.contains(&event.id) } else if event.content_warning().is_some() && !app.approved.contains(&event.id) && !app.settings.approve_content_warning
{ {
ui.label( ui.label(
RichText::new(format!( RichText::new(format!(
@ -914,7 +914,7 @@ fn render_content(
.monospace() .monospace()
.italics(), .italics(),
); );
if ui.button("Show Post").clicked() || app.settings.approve_content_warning if ui.button("Show Post").clicked()
{ {
app.approved.insert(event.id); app.approved.insert(event.id);
app.height.remove(&event.id); // will need to be recalculated. app.height.remove(&event.id); // will need to be recalculated.