diff --git a/src/app.rs b/src/app.rs index 45570cc..c165796 100644 --- a/src/app.rs +++ b/src/app.rs @@ -29,8 +29,15 @@ impl epi::App for TemplateApp { /// Called by the framework to load old app state (if any). #[cfg(feature = "persistence")] - fn load(&mut self, storage: &dyn epi::Storage) { - *self = epi::get_value(storage, epi::APP_KEY).unwrap_or_default() + fn setup( + &mut self, + _ctx: &egui::CtxRef, + _frame: &mut epi::Frame<'_>, + storage: Option<&dyn epi::Storage>, + ) { + if let Some(storage) = storage { + *self = epi::get_value(storage, epi::APP_KEY).unwrap_or_default() + } } /// Called by the frame work to save state before shutdown.