Hi I am writing a shiny app and on the server side code, I am calling a function when a user clicks the Run button. The issue I have is that the function takes around 10-25 minutes to run and a user might click the button multiple times during this period. After the function run is over, I show user the output path where the files have been downloaded and close the App. How can I prevent user from clicking the button multiple times, like a loading screen while the function is running?
observeEvent(input$runprocess, {
rundownload()
showModal(modalDialog(title ="Output folder: XYZ path",
actionButton("close", "Exit"),footer = NULL,
size = c("m"), easyClose = FALSE))
})
observeEvent(input$close, {
js$closeWindow()
stopApp()
})