Skip to content

Commit

Permalink
Os_tips: cancel all scheduled tips on page change
Browse files Browse the repository at this point in the history
  • Loading branch information
balat committed Jan 15, 2019
1 parent 872048a commit 1389f95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/os_tips.eliom
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ let%client onload_waiter () =
let%client waiter = ref (onload_waiter ())

let%client rec onchangepage_handler _ =
Lwt.cancel !waiter;
waiter := onload_waiter ();
(* onchangepage handlers are one-off, register ourselves again for
next time *)
Expand All @@ -189,7 +190,7 @@ let%client display_bubble ?(a = [])
~name ~content ()
=
let current_waiter = !waiter in
let new_waiter, new_wakener = Lwt.wait () in
let new_waiter, new_wakener = Lwt.task () in
waiter := new_waiter;
let%lwt () = current_waiter in
let bec = D.div ~a:[a_class ["os-tip-bec"]] [] in
Expand Down

0 comments on commit 1389f95

Please sign in to comment.