From ccdf0e668e5506099fb0be9f341a58c8ea100cff Mon Sep 17 00:00:00 2001 From: Victor Navarro Date: Wed, 13 Mar 2024 19:20:36 +0000 Subject: [PATCH] test --- R/launch_app.R | 4 +--- R/ui.R | 9 +++++---- man/calmr_ui.Rd | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/R/launch_app.R b/R/launch_app.R index 8ba7480..5b1010c 100644 --- a/R/launch_app.R +++ b/R/launch_app.R @@ -7,9 +7,7 @@ launch_app <- function( "resources", system.file("resources", package = "calmr.app") ) - ui <- calmr_ui( - analytics_file = NULL - ) + ui <- calmr_ui() server <- calmr_server() shiny::runApp(list(ui = ui, server = server), display.mode = "normal", launch.browser = browser diff --git a/R/ui.R b/R/ui.R index f6ab12a..4e7a6fc 100644 --- a/R/ui.R +++ b/R/ui.R @@ -2,10 +2,11 @@ #' @param analytics_file A path to google analytics. #' Default is NULL, in which case, no analytics are pushed. #' @export -calmr_ui <- function( - analytics_file = "inst/resources/google_analytics.html") { - if (!is.null(analytics_file)) { - analytics <- htmltools::includeHTML(analytics_file) +calmr_ui <- function(use_analytics = FALSE) { + if (use_analytics) { + analytics <- htmltools::includeHTML( + "inst/resources/google_analytics.html" + ) } else { analytics <- htmltools::HTML("") } diff --git a/man/calmr_ui.Rd b/man/calmr_ui.Rd index e1498c0..0bf5192 100644 --- a/man/calmr_ui.Rd +++ b/man/calmr_ui.Rd @@ -4,7 +4,7 @@ \alias{calmr_ui} \title{Build calmr.app UI} \usage{ -calmr_ui(analytics_file = "inst/resources/google_analytics.html") +calmr_ui(use_analytics = FALSE) } \arguments{ \item{analytics_file}{A path to google analytics.