Skip to content

Commit

Permalink
Merge pull request #529 from ocsigen/tips
Browse files Browse the repository at this point in the history
Add function Os_tips.tip_seen
  • Loading branch information
vouillon authored Jan 10, 2019
2 parents 8d25aac + f3d6cad commit 6c2a079
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
opam-version: "2.0"
name: "ocsigen-start"
version: "1.3.0"
version: "dev"
authors: "[email protected]"
maintainer: "[email protected]"
synopsis: "An Eliom application skeleton ready to use to build your own application with users, (pre)registration, notifications, etc"
Expand Down
4 changes: 4 additions & 0 deletions src/os_tips.eliom
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ let%client set_tip_seen name =
(Os_session.connected_wrapper set_tip_seen))
name

let%shared tip_seen name =
let%lwt seen = get_tips_seen () in
Lwt.return @@ Stringset.mem name seen

(* I want to see the tips again *)
let%server reset_tips_user myid_o =
match myid_o with
Expand Down
4 changes: 3 additions & 1 deletion src/os_tips.eliomi
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ val reset_tips : unit -> unit Lwt.t
*)
val set_tip_seen : string -> unit Lwt.t

[%%shared.start]
(** Returns whether a tip has been seen or not. *)
val tip_seen : string -> bool Lwt.t

(** A non-attached service that will reset tips.
Call it with [Eliom_client.exit_to] to restart the application and
see tips again. *)
Expand Down

0 comments on commit 6c2a079

Please sign in to comment.