Fix compilation with persistence feature
This commit is contained in:
parent
42ec177881
commit
9766a9ae08
|
@ -29,9 +29,16 @@ impl epi::App for TemplateApp {
|
||||||
|
|
||||||
/// Called by the framework to load old app state (if any).
|
/// Called by the framework to load old app state (if any).
|
||||||
#[cfg(feature = "persistence")]
|
#[cfg(feature = "persistence")]
|
||||||
fn load(&mut self, storage: &dyn epi::Storage) {
|
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()
|
*self = epi::get_value(storage, epi::APP_KEY).unwrap_or_default()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Called by the frame work to save state before shutdown.
|
/// Called by the frame work to save state before shutdown.
|
||||||
#[cfg(feature = "persistence")]
|
#[cfg(feature = "persistence")]
|
||||||
|
|
Loading…
Reference in a new issue