Skip to content

Commit

Permalink
fix app run without persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
ahirner committed Nov 20, 2022
1 parent 9e72a0e commit b510ec5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions infur/src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ impl eframe::App for InFur {
self.allow_closing
}

#[cfg(feature = "persistence")]
fn save(&mut self, storage: &mut dyn eframe::Storage) {
eframe::set_value(storage, eframe::APP_KEY, &self.config);
}
Expand Down
9 changes: 5 additions & 4 deletions infur/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,16 @@ fn main() -> Result<()> {
"InFur",
window_opts,
Box::new(|cc| {
let config = match cc.storage {
let mut config = match cc.storage {
#[cfg(feature = "persistence")]
Some(storage) => eframe::get_value(storage, eframe::APP_KEY).unwrap_or_default(),
None => todo!(),
_ => gui::ProcConfig::default(),
};
let mut app_gui = gui::InFur::new(config, ctrl_tx_gui, frame_rx, ctrl_result_rx);
// still override video from args
if !args.is_empty() {
app_gui.config.video_input = args;
config.video_input = args;
}
let app_gui = gui::InFur::new(config, ctrl_tx_gui, frame_rx, ctrl_result_rx);
Box::new(app_gui)
}),
);
Expand Down

0 comments on commit b510ec5

Please sign in to comment.