summaryrefslogtreecommitdiff
path: root/editor/editor.ml
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor.ml')
-rwxr-xr-xeditor/editor.ml11
1 files changed, 9 insertions, 2 deletions
diff --git a/editor/editor.ml b/editor/editor.ml
index c80b426..51ff3e4 100755
--- a/editor/editor.ml
+++ b/editor/editor.ml
@@ -77,8 +77,15 @@ module Store = struct
let save = State.Storage.save
content_obj
state.page_id
- ~check:(fun previous_state ->
- Js.Opt.case previous_state##.date
+ (* There three date here :
+ - The actual date at the time we save the note
+ - The date associated with the note when we loaded it first time
+ - The date associated with the note at the time we want to update it
+
+ The two last may differ if the note has been updated in another one tab. *)
+ ~check:(fun ~previous ~update ->
+ let _ = update in
+ Js.Opt.case previous##.date
(fun () -> true)
(fun date ->
(* I do not figure how the previous date could be older