clear preview charts when a capture is started

This commit is contained in:
GyulyVGC
2025-12-20 09:59:56 +01:00
parent 5da6cfce61
commit 6d331537a3

View File

@@ -834,6 +834,9 @@ fn start(&mut self) -> Task<Message> {
rx.close(); rx.close();
} }
self.preview_captures_rx = None; 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(_)) { if matches!(&self.capture_source, CaptureSource::Device(_)) {
let current_device_name = &self.capture_source.get_name(); let current_device_name = &self.capture_source.get_name();
@@ -899,9 +902,6 @@ fn reset(&mut self) -> Task<Message> {
// increment capture id to ignore pending messages from previous captures // increment capture id to ignore pending messages from previous captures
self.current_capture_rx = (self.current_capture_rx.0 + 1, None); self.current_capture_rx = (self.current_capture_rx.0 + 1, None);
self.info_traffic = InfoTraffic::default(); self.info_traffic = InfoTraffic::default();
self.preview_charts
.iter_mut()
.for_each(|(_, chart)| *chart = PreviewChart::new(style));
self.addresses_resolved = HashMap::new(); self.addresses_resolved = HashMap::new();
self.favorite_hosts = HashSet::new(); self.favorite_hosts = HashSet::new();
self.logged_notifications = (VecDeque::new(), 0); self.logged_notifications = (VecDeque::new(), 0);