From 00867004046968c931d4e112e1553c0674c5b74b Mon Sep 17 00:00:00 2001 From: Peter Solymos Date: Tue, 16 Jul 2024 21:56:56 +0200 Subject: [PATCH] Fix initial message issue with Shiny #69 Signed-off-by: Peter Solymos --- NEWS.md | 4 ++++ R/unix/startpb.R | 4 +++- R/windows/startpb.R | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 7de55e7..5b59945 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# Version 1.7-3, July 16, 2024 + +* Fixed initial message issue with Shiny (#69). + # Version 1.7-2, June 27, 2023 * Documented `.pb_env` environment to address WARNING after CRAN submission. diff --git a/R/unix/startpb.R b/R/unix/startpb.R index d373d62..1a295c0 100644 --- a/R/unix/startpb.R +++ b/R/unix/startpb.R @@ -17,8 +17,10 @@ function(min=0, max=1) initial = control$initial, title = control$title, label = control$label, width = control$gui.width)) - if (doshiny()) + if (doshiny()) { pb <- shiny::Progress$new(min=min, max=max) + setpb(pb, 0) + } } else { pb <- NULL } diff --git a/R/windows/startpb.R b/R/windows/startpb.R index dfa50d2..0f7ad33 100644 --- a/R/windows/startpb.R +++ b/R/windows/startpb.R @@ -21,8 +21,10 @@ function(min=0, max=1) initial=control$initial, title = control$title, label = control$label, width = control$gui.width)) - if (doshiny()) + if (doshiny()) { pb <- shiny::Progress$new(min=min, max=max) + setpb(pb, 0) + } } else { pb <- NULL }