From 7055c814d848e5b18f3af44fb3f616f2c331187a Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Sun, 2 Apr 2023 17:27:30 +0800 Subject: [PATCH] avoid refresh loop #20 --- R/mod_infrasap_tab_module.R | 40 +++++++++++-------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/R/mod_infrasap_tab_module.R b/R/mod_infrasap_tab_module.R index 1492206..b426787 100644 --- a/R/mod_infrasap_tab_module.R +++ b/R/mod_infrasap_tab_module.R @@ -165,34 +165,18 @@ mod_infrasap_tab_module_server <- function(id){ output$countriestc <- shiny::renderUI({ shiny::req(countriesOptionsInput()) countryList <- country_to_compare_list(infrasap_dat_mod_modified, input$db_sector, input$db_pillar) - - if(is.null(selected_vals$db_countries_name)) { - shiny::selectizeInput(inputId = ns('country_to_compare_id'), - label = 'Countries to compare to', - choices = sort(unique(countryList)), - selected = countriesOptionsInput(), - multiple = TRUE, - options = list( - maxItems = 3, - 'plugins' = list('remove_button'), - 'create' = TRUE, - 'persist' = FALSE - ) - ) - } else { - shiny::selectizeInput(inputId = ns('country_to_compare_id'), - label = 'Countries to compare to', - choices = sort(unique(countryList)), - selected = selected_vals$db_countries_name, - multiple = TRUE, - options = list( - maxItems = 3, - 'plugins' = list('remove_button'), - 'create' = TRUE, - 'persist' = FALSE - ) - ) - } + shiny::selectizeInput(inputId = ns('country_to_compare_id'), + label = 'Countries to compare to', + choices = sort(unique(countryList)), + selected = countriesOptionsInput(), + multiple = TRUE, + options = list( + maxItems = 3, + 'plugins' = list('remove_button'), + 'create' = TRUE, + 'persist' = FALSE + ) + ) })