1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

[web] fix auto-save

This commit is contained in:
Emil Ernerfeldt
2020-07-19 00:16:24 +02:00
parent 376610a0ca
commit f659f2903d

View File

@@ -102,7 +102,7 @@ impl Backend {
pub fn auto_save(&mut self) {
let now = now_sec();
let time_since_last_save = now - self.last_save_time.unwrap_or(now);
let time_since_last_save = now - self.last_save_time.unwrap_or(std::f64::NEG_INFINITY);
const AUTO_SAVE_INTERVAL: f64 = 5.0;
if time_since_last_save > AUTO_SAVE_INTERVAL {
self.last_save_time = Some(now);