Skip to content

Commit

Permalink
no error if showLog() is called multiple times; fixes #105
Browse files Browse the repository at this point in the history
  • Loading branch information
daattali committed Dec 15, 2016
1 parent 3de2b75 commit e9c7e88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions R/showLog.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
showLog <- function() {
session <- getSession()

if (!is.null(attr(session, "shinyjs_showLog"))) {
return()
}
attr(session, "shinyjs_showLog") <- TRUE

# Capture the console.log function and overwrite it to send the message to R
shiny::insertUI("head", "beforeEnd", {
shiny::singleton(shiny::tags$head(shiny::tags$script(
Expand Down
2 changes: 1 addition & 1 deletion R/useShinyjs.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ useShinyjs <- function(rmd = FALSE, debug = FALSE, html = FALSE,
stopifnot(html == TRUE || html == FALSE)

if (!missing(showLog)) {
warning("'showLog' has been deprecated. You do not need to call it anymore.",
warning("'useShinyjs(showLog = TRUE)' has been deprecated. You do not need to call it anymore.",
call. = FALSE)
}

Expand Down

0 comments on commit e9c7e88

Please sign in to comment.