In the app below when the user does not upload a .xls file I want a pop up to be displayed. Now it appears only in the beginning but if upload another lets say doc file it is hidden. I do not care it is with shinyalert package or other method.
library(shiny)
library(shinyalert)
ui <- fluidPage(
useShinyalert(), # Set up shinyalert
fileInput('file1', 'Choose xls file',
accept = c(".xls")
)
)
server <- function(input, output, session) {
observeEvent(input$file1, {
if (is.null(input$file1))
# Show a modal when the button is pressed
shinyalert("Oops!", "Something went wrong.", type = "error")
}, ignoreNULL = FALSE)
}
shinyApp(ui, server)