From 561421f35a5655b850468e1aa0c72eb290691732 Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Fri, 23 Dec 2022 15:51:15 +1300 Subject: [PATCH] ui: feed: skip events that are not TextNotes (just in case get_feed is buggy) --- src/ui/feed.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/feed.rs b/src/ui/feed.rs index 96a2b560..6f86cf85 100644 --- a/src/ui/feed.rs +++ b/src/ui/feed.rs @@ -1,7 +1,7 @@ use super::GossipUi; use eframe::egui; use egui::{Align, Color32, Context, Layout, RichText, ScrollArea, TextStyle, Ui, Vec2}; -use nostr_proto::{Id, PublicKey}; +use nostr_proto::{EventKind, Id, PublicKey}; use tracing::info; pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Frame, ui: &mut Ui) { @@ -62,6 +62,11 @@ fn render_post( } // don't render related info w/o nostr event. let event = fevent.event.as_ref().unwrap().to_owned(); + // Only render TextNote events + if event.kind != EventKind::TextNote { + return; + } + let maybe_person = crate::globals::GLOBALS .people .blocking_lock()