Skip to content

Commit

Permalink
Ot_spinner: make sure that the onloaded event is never destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Jun 24, 2016
1 parent 5cb3928 commit 910956f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/widgets/ot_spinner.eliom
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ let%server with_spinner ?(a = []) ?fail thread =

let num_active_spinners, set_num_active_spinners = React.S.create 0
let onloaded, set_onloaded = React.E.create ()
(* Make sure the signal is not destroyed indirectly
by a call to React.E.stop *)
let _ = ignore (React.E.map (fun _ -> ()) onloaded)
let _ = Eliom_client.onload @@ fun () ->
if React.S.value num_active_spinners = 0 then set_onloaded ()
let inc_active_spinners () =
Expand Down

0 comments on commit 910956f

Please sign in to comment.