From 2bf2f444fa5f2cd527f140dcac6f5eb80997b699 Mon Sep 17 00:00:00 2001 From: Brancen Gregory Date: Mon, 15 Apr 2024 16:20:26 -0500 Subject: [PATCH] Update progress bar to be current and run in caller env --- R/ojo_collect.R | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/R/ojo_collect.R b/R/ojo_collect.R index 271e014..ac91488 100644 --- a/R/ojo_collect.R +++ b/R/ojo_collect.R @@ -110,13 +110,14 @@ collect_data <- function(.con, .data, n_results, .silent) { } } - if (!.silent) { - cli::cli_progress_done() - } - return(res) } init_progress_bar <- function(n_results) { - cli::cli_progress_bar(name = "dl_pb", total = n_results, clear = FALSE) + cli::cli_progress_bar( + type = "iterator", + total = n_results, + clear = FALSE, + .envir = rlang::caller_env() + ) }