Skip to content

Commit

Permalink
revert: argument name to condExpr as it needs to be a logical
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Oct 11, 2024
1 parent 07eb8f2 commit 5a60dfe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 7 additions & 3 deletions R/module_nested_tabs.R
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,19 @@ srv_teal_module.teal_module <- function(id,
#' @return An observer.
#'
#' @keywords internal
call_once_when <- function(eventExpr, # nolint: object_name.
call_once_when <- function(condExpr, # nolint: object_name.
handlerExpr, # nolint: object_name.
event.env = parent.frame(), # nolint: object_name.
handler.env = parent.frame(), # nolint: object_name.
...) {
event_quo <- rlang::new_quosure(substitute(eventExpr), env = event.env)
if ("eventExpr" %in% names(rlang::list2(...))) {
stop("eventExpr is not allowed in call_once_when.")
}

event_quo <- rlang::new_quosure(substitute(condExpr), env = event.env)
handler_quo <- rlang::new_quosure(substitute(handlerExpr), env = handler.env)

# When `eventExpr` is TRUE, then `handlerExpr` is evaluated once.
# When `condExpr` is TRUE, then `handlerExpr` is evaluated once.
activator <- reactive({
if (isTRUE(rlang::eval_tidy(event_quo))) {
TRUE
Expand Down
9 changes: 2 additions & 7 deletions man/call_once_when.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5a60dfe

Please sign in to comment.