hide media on universe view

Also fixes textmode

Fixes: https://github.com/damus-io/notedeck/issues/443
This commit is contained in:
William Casarin
2024-11-17 16:44:52 -08:00
parent 33b2fa263e
commit a678e647a4
7 changed files with 86 additions and 23 deletions

View File

@@ -139,6 +139,7 @@ fn render_note_contents(
let selectable = options.has_selectable_text();
let mut images: Vec<String> = vec![];
let mut inline_note: Option<(&[u8; 32], &str)> = None;
let hide_media = options.has_hide_media();
let response = ui.horizontal_wrapped(|ui| {
let blocks = if let Ok(blocks) = ndb.get_blocks_by_key(txn, note_key) {
@@ -183,7 +184,7 @@ fn render_note_contents(
BlockType::Url => {
let lower_url = block.as_str().to_lowercase();
if lower_url.ends_with("png") || lower_url.ends_with("jpg") {
if !hide_media && (lower_url.ends_with("png") || lower_url.ends_with("jpg")) {
images.push(block.as_str().to_string());
} else {
#[cfg(feature = "profiling")]