Skip to content

Commit

Permalink
remove firewall auto sync when quit app
Browse files Browse the repository at this point in the history
  • Loading branch information
pythops committed Oct 13, 2024
1 parent 33fc05d commit f6147d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions oryx-tui/src/app.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use log::error;
use oryx_common::RawPacket;
use ratatui::{
layout::{Constraint, Direction, Layout},
Expand Down Expand Up @@ -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;
}
}
6 changes: 3 additions & 3 deletions oryx-tui/src/section/firewall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
},

Expand Down

0 comments on commit f6147d9

Please sign in to comment.