Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual error with infinite line waitress when restarting the loading bar #85

Open
Dschaykib opened this issue Feb 5, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@Dschaykib
Copy link

Dschaykib commented Feb 5, 2021

Hi,
when using the waitress with line and infinite settings, there is a bug with the loading bar if a second $start() is initialized before a $close() is stated.

Sample Code for a simple App with a start and stop button and a visual of the error:

library(shiny)
library(waiter)

ui <- fluidPage(
  use_waitress(),
  p("App content"),
  uiOutput("start_button"),
  uiOutput("stop_button"),
  uiOutput("exit_button"),
  textOutput(outputId = "desc")
)

server <- function(input, output){

  output$exit_button <- renderUI({
    actionButton("exit", label = "Exit", width= "20%")
  })
  output$stop_button <- renderUI({
    actionButton("stop", label = "Stop", width= "20%")
  })
  output$start_button <- renderUI({
    actionButton("start", label = "Start", width= "20%")
  })
  output$desc <- renderText({
    paste0("Initial time ", Sys.time())
  })
  
  # call the waitress
  waitress <- Waitress$new(theme = "line", infinite = TRUE)
  
  observeEvent(input$stop, {
    waitress$close()
    output$desc <- renderText({paste0("stop at ", Sys.time())})
  })
  
  observeEvent(input$exit, {
    shiny::stopApp()
  })
    
  observeEvent(input$start, {
    waitress$start()
    output$desc <- renderText({paste0("start at ", Sys.time())})
  })
}

shinyApp(ui, server)
loading_bar_error.mov
@JohnCoene
Copy link
Owner

Sorry I have not fixed this yet, it's really busy with work on my end at the moment.

@JohnCoene JohnCoene added the bug Something isn't working label Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants