From 5dd2f0f840eec6b2d79fe1f55b9384627e0d5712 Mon Sep 17 00:00:00 2001 From: facundoy Date: Mon, 2 Dec 2024 18:20:06 -0500 Subject: [PATCH] Correctly merged dev-branch Main with PR Main --- src/haz3lweb/Main.re | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/haz3lweb/Main.re b/src/haz3lweb/Main.re index d6c92d092..bf7904676 100644 --- a/src/haz3lweb/Main.re +++ b/src/haz3lweb/Main.re @@ -37,13 +37,27 @@ let apply = (model, action, ~schedule_action, ~schedule_autosave): Model.t => { | (UpdateAction.PerformAction(Move(_)), true) => model | (action, _) => if (UpdateAction.is_edit(action)) { - last_edit_action := JsUtil.timestamp(); - edit_action_applied := true; + schedule_autosave( + BonsaiUtil.Alarm.Action.SetAlarm( + Core.Time_ns.add( + Core.Time_ns.now(), + Core.Time_ns.Span.of_sec(1.0), + ), + ), + ); + } else { + schedule_autosave( + BonsaiUtil.Alarm.Action.SnoozeAlarm( + Core.Time_ns.add( + Core.Time_ns.now(), + Core.Time_ns.Span.of_sec(1.0), + ), + ), + ); }; if (Update.should_scroll_to_caret(action)) { scroll_to_caret := true; }; - last_edit_action := JsUtil.timestamp(); switch ( try({ let new_model = Update.apply(model, action, ~schedule_action);