From f6147d9d2fdf7479e8331642eea9684b60eda124 Mon Sep 17 00:00:00 2001 From: Badr Date: Sun, 13 Oct 2024 13:51:25 +0200 Subject: [PATCH] remove firewall auto sync when quit app --- oryx-tui/src/app.rs | 6 ------ oryx-tui/src/section/firewall.rs | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/oryx-tui/src/app.rs b/oryx-tui/src/app.rs index e21e474..d160af4 100644 --- a/oryx-tui/src/app.rs +++ b/oryx-tui/src/app.rs @@ -1,4 +1,3 @@ -use log::error; use oryx_common::RawPacket; use ratatui::{ layout::{Constraint, Direction, Layout}, @@ -130,15 +129,10 @@ impl App { pub fn tick(&mut self) { self.notifications.iter_mut().for_each(|n| n.ttl -= 1); self.notifications.retain(|n| n.ttl > 0); - self.section.alert.check(); } pub fn quit(&mut self) { - if let Err(e) = self.section.firewall.save_rules() { - error!("{}", e) - } - self.running = false; } } diff --git a/oryx-tui/src/section/firewall.rs b/oryx-tui/src/section/firewall.rs index 33849d8..0b5744b 100644 --- a/oryx-tui/src/section/firewall.rs +++ b/oryx-tui/src/section/firewall.rs @@ -557,18 +557,18 @@ impl Firewall { KeyCode::Char('s') => match self.save_rules() { Ok(_) => { Notification::send( - "Firewall rules saved to ~/oryx/firewall.json file", + "Sync firewall rules to ~/oryx/firewall.json", crate::notification::NotificationLevel::Info, sender.clone(), )?; } Err(e) => { Notification::send( - "Error while saving firewall rules.", + "Error while syncing firewall rules", crate::notification::NotificationLevel::Error, sender.clone(), )?; - error!("Error while saving firewall rules. {}", e); + error!("Error while syncing firewall rules. {}", e); } },