Hide and display Text based on actionButton and selected choices of shiny widget

In the shiny app below I have 2 shiny widgets related to each other and then a Preview button which is activated when we have values in shools widgets. When I click Preview also a text is displayed. The issue is that I want this text to be hidden when I have no values in my school widgets. And then displayed again when I have at least one school selected and click Preview.

library(renv)
library(dplyr)
library(shiny)
library(shinyWidgets)
library(DT)
library(tidyr)
early<-structure(list(temp_record_id = c("3_8", "3_14", "3_20", "3_35", 
                                         "3_45", "3_49", "3_59", "3_67", "3_72", "3_79"), district_number = c("0001", 
                                                                                                              "0001", "0001", "0014", "0038", "0110", "0113", "0196", "0200", 
                                                                                                              "0273"), district_type = c("33", "33", "33", "31", "31", "31", 
                                                                                                                                         "31", "31", "31", "31"), school_number = c("012", "015", "036", 
                                                                                                                                                                                    "006", "001", "001", "100", "007", "002", "007"), grade = c("03", 
                                                                                                                                                                                                                                                "03", "03", "03", "03", "03", "03", "03", "03", "03"), subject = c("Reading", 
                                                                                                                                                                                                                                                                                                                   "Reading", "Reading", "Reading", "Reading", "Reading", "Reading", 
                                                                                                                                                                                                                                                                                                                   "Reading", "Reading", "Reading"), group_category = c("All Categories", 
                                                                                                                                                                                                                                                                                                                                                                        "All Categories", "All Categories", "All Categories", "All Categories", 
                                                                                                                                                                                                                                                                                                                                                                        "All Categories", "All Categories", "All Categories", "All Categories", 
                                                                                                                                                                                                                                                                                                                                                                        "All Categories"), student_group = c("All Students", "All Students", 
                                                                                                                                                                                                                                                                                                                                                                                                             "All Students", "All Students", "All Students", "All Students", 
                                                                                                                                                                                                                                                                                                                                                                                                             "All Students", "All Students", "All Students", "All Students"
                                                                                                                                                                                                                                                                                                                                                                        ), school_year = c(2015, 2015, 2015, 2015, 2015, 2015, 2015, 
                                                                                                                                                                                                                                                                                                                                                                                           2015, 2015, 2015), denominator = c(40, 31, 21, 21, 12, 18, NA, 
                                                                                                                                                                                                                                                                                                                                                                                                                              22, 14, 80), numerator = c(17, 12, 9, 10, 4, 13, NA, 19, 11, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                         68), school_name = c("Ascension Catholic School", "Risen Christ", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "St. Helena Catholic School", "Al-Amal School", "St. Mary's Mission", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "St. Joseph", "Immanuel Lutheran School", "St. Joseph's Catholic", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "St. John The Baptist", "Our Lady Of Grace"), district_name = c("Nonpublic School", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "Nonpublic School", "Nonpublic School", "Nonpublic School", "Nonpublic School", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "Nonpublic School", "Nonpublic School", "Nonpublic School", "Nonpublic School", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "Nonpublic School"), county_name = c("Hennepin", "Hennepin", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "Hennepin", "Anoka", "Beltrami", "Carver", "Cass", "Dakota", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "Dakota", "Hennepin"), school_classification = c("00", "00", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "00", "40", "00", "00", "00", "00", "00", "00"), school_name_unique = c("Ascension Catholic School 0001-33-012", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "Risen Christ 0001-33-015", "St. Helena Catholic School 0001-33-036", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "Al-Amal School 0014-31-006", "St. Mary's Mission 0038-31-001", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "St. Joseph 0110-31-001", "Immanuel Lutheran School 0113-31-100", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "St. Joseph's Catholic 0196-31-007", "St. John The Baptist 0200-31-002", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "Our Lady Of Grace 0273-31-007"), id = c("0001-33-012", "0001-33-015", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "0001-33-036", "0014-31-006", "0038-31-001", "0110-31-001", "0113-31-100", 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "0196-31-007", "0200-31-002", "0273-31-007")), row.names = c(NA, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  -10L), class = c("tbl_df", "tbl", "data.frame"))

all_districts <- unique(sort(early$district_name))
all_schools <- unique(sort(early$school_name_unique))

# Define UI for application that draws a histogram
ui <- fluidPage(
  
  # Application title
  titlePanel("CIA Data Prep"),
  
  # Sidebar with a slider input for number of bins 
  sidebarLayout(
    sidebarPanel(
      h2("Select Schools to Include"),
      shinyWidgets::pickerInput(inputId = "districts",
                                label = "Districts:",
                                choices = all_districts,
                                options = list(`actions-box` = TRUE),
                                multiple = TRUE),
      shinyWidgets::pickerInput(inputId = "schools",
                                label = "Schools:",
                                choices = "",
                                options = list(`actions-box` = TRUE),
                                selected = "",
                                multiple = TRUE),
      shiny::actionButton(inputId = "runButton", label = "Preview", disabled = TRUE),
      shiny::actionButton(inputId = "downButton", label = "Download", disabled = TRUE)),
    
    # Show a plot of the generated distribution
    mainPanel(
      fluidRow(
        column(6,uiOutput("ear"))
      )
      
      )
      
    )
  )

# Define server logic required to draw a histogram
server <- function(input, output, session) {
  observeEvent(input$districts, {
    if (!is.null(input$districts) && length(input$districts) > 0) {
      shinyWidgets::updatePickerInput(
        session = session,
        inputId = "schools",
        choices = early %>% dplyr::arrange(district_name, school_name_unique) %>% dplyr::filter(district_name %in% input$districts) %>% dplyr::select(school_name_unique) %>% unique() %>% pull()
      )
    } else {
      shinyWidgets::updatePickerInput(
        session = session,
        inputId = "schools",
        choices = "",
        options = list(`actions-box` = TRUE),
        selected = ""
      )
      updateActionButton(session, "runButton", disabled = TRUE)
      updateActionButton(session, "downButton", disabled = TRUE)
    }
  }, ignoreNULL = FALSE)
  
  observeEvent(input$schools, {
    if (!is.null(input$schools) &&
        length(input$schools) > 0 && any(input$schools != "")) {
      updateActionButton(inputId = "runButton",
                         disabled = FALSE)
    } else {
      updateActionButton(inputId = "runButton",
                         disabled = TRUE)
      updateActionButton(inputId = "downButton",
                         disabled = TRUE)
    }
  }, ignoreNULL = FALSE)
  
  observeEvent(input$runButton, {
    if (input$runButton > 0) {
      updateActionButton(inputId = "downButton",
                         disabled = FALSE)
    }
  })
  
  shiny::observeEvent(input$runButton, {
    if (is.null(input$schools) ||
        any(input$schools == "") || input$runButton == 0) {
      output$ear <- renderUI({HTML("")})
    }
    
    else{
      output$ear <- renderUI({
        HTML("Early Reading Grades")
        
      })
      
    }
  })
  
}

# Run the application 
shinyApp(ui = ui, server = server)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật