From cf4de2090c88d0f4e04f832a428d913f78332b30 Mon Sep 17 00:00:00 2001 From: Ciara Donegan <82416895+ciara-donegan@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:03:15 -0400 Subject: [PATCH] No longer crashes when selecting variable before clicking "Load Graphs" New variables can be selected without having to click "Load Graphs" first, by carrying over the "runs" var as r6$output instead of creating a new blank variable. This does cause the app to crash if a new SSP is selected after selecting new variables, though, so it's not a complete fix --- inst/shinyApp/components/modules/mod_run.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inst/shinyApp/components/modules/mod_run.R b/inst/shinyApp/components/modules/mod_run.R index 12fee0f..bdde66c 100644 --- a/inst/shinyApp/components/modules/mod_run.R +++ b/inst/shinyApp/components/modules/mod_run.R @@ -133,6 +133,7 @@ run_server <- function(id, r6) { runs[[i]] <- fetchvars(r6$core[[i]], r6$time()[1]:r6$time()[2], vars = list(r6$selected_var())) %>% mutate(Scenario = names(which(scenarios == input$ssp_path[i], arr.ind = FALSE))) } + #browser() r6$output <- bind_rows(runs) print("Done") @@ -146,7 +147,7 @@ run_server <- function(id, r6) { observe({ r6$selected_var <- reactive({input$variable}) - runs <- list() + runs <- list(r6$output) for(i in 1:length(input$ssp_path)) { runs[[i]] <- fetchvars(r6$core[[i]], r6$time()[1]:r6$time()[2], vars = list(r6$selected_var())) %>%