Skip to content

Commit

Permalink
Merge pull request #782 from ocsigen/hist
Browse files Browse the repository at this point in the history
Fix back button not working when going back to a server side generated page
  • Loading branch information
vouillon authored Feb 21, 2024
2 parents 6fcdc79 + a12674b commit 7586428
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/lib/eliom_client.client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2095,23 +2095,23 @@ let () =
let rf =
Option.bind old_page @@ fun {reload_function = rf; _} -> rf
in
reload_function := rf;
let%lwt () = run_lwt_callbacks ev (flush_onchangepage ()) in
with_new_page ~state_id ?old_page ~replace:false () @@ fun () ->
set_current_uri uri;
History.replace (get_this_page ());
let%lwt () =
match rf with
| None -> Lwt.return_unit
| Some f -> (
match rf with
| None -> raise Not_found
| Some f ->
reload_function := rf;
let%lwt () = run_lwt_callbacks ev (flush_onchangepage ()) in
with_new_page ~state_id ?old_page ~replace:false () @@ fun () ->
set_current_uri uri;
History.replace (get_this_page ());
let%lwt () =
match%lwt f () () with
| Eliom_service.Dom d -> set_content_local d
| r ->
handle_result ~uri:(get_current_uri ()) ~replace:true
(Lwt.return r))
in
scroll_to_fragment ~offset:state.position fragment;
Lwt.return_unit
(Lwt.return r)
in
scroll_to_fragment ~offset:state.position fragment;
Lwt.return_unit
with Not_found -> (
(* different session ID *)
set_current_uri uri;
Expand Down

0 comments on commit 7586428

Please sign in to comment.