Skip to content

Commit

Permalink
add progress indicator starting #88
Browse files Browse the repository at this point in the history
  • Loading branch information
maxheld83 committed Feb 10, 2021
1 parent 7f795a0 commit 39c137f
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions inst/app/index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,26 @@ iv$enable()
html_email <- eventReactive(input$create, {
if (length(dois()) > 1) {
render_email(dois = dois(), session_id = session_id)$html_html
withProgress(
expr = {
render_email(dois = dois(), session_id = session_id)$html_html
},
message = "Generating report..."
)
}
})
output$draft <- renderUI(html_email())
observeEvent(input$send, {
if (length(dois() > 1 & iv$is_valid())) {
send_email(
to = input$email,
email = render_email(dois = dois(), session_id = session_id)
withProgress(
expr = {
send_email(
to = input$email,
email = render_email(dois = dois(), session_id = session_id)
)
},
message = "Generating report and sending e-mail. You can close this window."
)
}
})
Expand Down

0 comments on commit 39c137f

Please sign in to comment.