JohnCoene / waiter

🕰️ Loading screens for Shiny
https://waiter.john-coene.com/
Other
495 stars 25 forks source link

using waiterOnBusy() does not produce a grey screen when the server disconnects or the app encounters an error #116

Closed WahiduzzamanKhan closed 2 years ago

WahiduzzamanKhan commented 2 years ago

When I use waiterOnBusy() in my ui.r to show full-screen loading animation, it doesn't show a grey screen when the server disconnects or the app stops because of an error. This can really hamper the user experience as there is no indication that the app has stopped working while the user just keeps waiting.

Here is a reproducible example:

library(shiny)
library(waiter)

ui <- fluidPage(
  use_waiter(),
  waiterOnBusy(),
  actionButton("gen_error", 'Generate error'),
)

server <- function(input, output){
  observeEvent(
    input$gen_error,
    {
      Sys.sleep(5)
      stop('no grey, why?')
    }
  )

}

shinyApp(ui, server)
JohnCoene commented 2 years ago

Thanks for reporting this, I pushed a fix. You can reinstall the development version.

WahiduzzamanKhan commented 2 years ago

Thanks for reporting this, I pushed a fix. You can reinstall the development version.

Thanks for the quick fix