Skip to content

Commit f6147d9

Browse files
committedOct 13, 2024·
remove firewall auto sync when quit app
1 parent 33fc05d commit f6147d9

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed
 

‎oryx-tui/src/app.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use log::error;
21
use oryx_common::RawPacket;
32
use ratatui::{
43
layout::{Constraint, Direction, Layout},
@@ -130,15 +129,10 @@ impl App {
130129
pub fn tick(&mut self) {
131130
self.notifications.iter_mut().for_each(|n| n.ttl -= 1);
132131
self.notifications.retain(|n| n.ttl > 0);
133-
134132
self.section.alert.check();
135133
}
136134

137135
pub fn quit(&mut self) {
138-
if let Err(e) = self.section.firewall.save_rules() {
139-
error!("{}", e)
140-
}
141-
142136
self.running = false;
143137
}
144138
}

‎oryx-tui/src/section/firewall.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -557,18 +557,18 @@ impl Firewall {
557557
KeyCode::Char('s') => match self.save_rules() {
558558
Ok(_) => {
559559
Notification::send(
560-
"Firewall rules saved to ~/oryx/firewall.json file",
560+
"Sync firewall rules to ~/oryx/firewall.json",
561561
crate::notification::NotificationLevel::Info,
562562
sender.clone(),
563563
)?;
564564
}
565565
Err(e) => {
566566
Notification::send(
567-
"Error while saving firewall rules.",
567+
"Error while syncing firewall rules",
568568
crate::notification::NotificationLevel::Error,
569569
sender.clone(),
570570
)?;
571-
error!("Error while saving firewall rules. {}", e);
571+
error!("Error while syncing firewall rules. {}", e);
572572
}
573573
},
574574

0 commit comments

Comments
 (0)
Please sign in to comment.