Skip to content

Commit

Permalink
No longer crashes when selecting variable before clicking "Load Graphs"
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ciara-donegan committed Aug 22, 2024
1 parent 12160d7 commit cf4de20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inst/shinyApp/components/modules/mod_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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())) %>%
Expand Down

0 comments on commit cf4de20

Please sign in to comment.