From 62b0e1254cf97b484440050ed7b7addf086c7bfd Mon Sep 17 00:00:00 2001 From: DivadNojnarg Date: Mon, 22 Jan 2024 17:54:18 +0100 Subject: [PATCH] session issue --- R/helpers-charts.R | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/R/helpers-charts.R b/R/helpers-charts.R index d4b36f1..e250ad1 100644 --- a/R/helpers-charts.R +++ b/R/helpers-charts.R @@ -26,7 +26,12 @@ create_calendar_chart <- function( Date <- Freq <- NULL - session <- get("session", parent.frame(2)) + tryCatch({ + session <- get("session", parent.frame(2)) + ns <- session$ns + }, error = function(e) { + ns <- identity + }) renderEcharts4r({ validate(need(nrow(calendar_data()) > 0, "No calendar data found ...")) @@ -60,7 +65,7 @@ create_calendar_chart <- function( "function(e) { Shiny.setInputValue('%s', e.data.value[0], {priority: 'event'}); }", - session$ns("selected_date") + ns("selected_date") ) )