From 6d331537a3f7f0c09ccfa7598369c15d75a431c7 Mon Sep 17 00:00:00 2001 From: GyulyVGC Date: Sat, 20 Dec 2025 09:59:56 +0100 Subject: [PATCH] clear preview charts when a capture is started --- src/gui/sniffer.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/sniffer.rs b/src/gui/sniffer.rs index f480e111..12dd0f26 100644 --- a/src/gui/sniffer.rs +++ b/src/gui/sniffer.rs @@ -834,6 +834,9 @@ fn start(&mut self) -> Task { rx.close(); } self.preview_captures_rx = None; + self.preview_charts + .iter_mut() + .for_each(|(_, chart)| *chart = PreviewChart::new(self.conf.settings.style)); if matches!(&self.capture_source, CaptureSource::Device(_)) { let current_device_name = &self.capture_source.get_name(); @@ -899,9 +902,6 @@ fn reset(&mut self) -> Task { // increment capture id to ignore pending messages from previous captures self.current_capture_rx = (self.current_capture_rx.0 + 1, None); self.info_traffic = InfoTraffic::default(); - self.preview_charts - .iter_mut() - .for_each(|(_, chart)| *chart = PreviewChart::new(style)); self.addresses_resolved = HashMap::new(); self.favorite_hosts = HashSet::new(); self.logged_notifications = (VecDeque::new(), 0);