From 1af3642ed68953dafe23e31e28b21f1715c91e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ver=C3=ADssimo?= <211358+averissimo@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:08:42 +0000 Subject: [PATCH] fix: minor bug --- R/tm_g_distribution.R | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index 1fb9b3979..8e84ed76a 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -1321,11 +1321,18 @@ srv_distribution <- function(id, decorated_output_q <- reactive({ tab <- req(input$tabs) # tab is NULL upon app launch, hence will crash without this statement - if (tab == "Histogram") { - c(decorated_output_dist_q(), decorated_output_summary_q(), decorated_output_test_q()) - } else if (tab == "QQplot") { - c(decorated_output_qq_q(), decorated_output_summary_q(), decorated_output_test_q()) + test_q_out <- try(test_q(), silent = TRUE) + decorated_test_q_out <- if (inherits(test_q_out, c("try-error", "error"))) { + teal.code::qenv() + } else { + decorated_output_test_q() } + + out_q <- switch(tab, + Histogram = decorated_output_dist_q(), + QQplot = decorated_output_qq_q() + ) + c(out_q, decorated_output_summary_q(), decorated_test_q_out) }) dist_r <- reactive(req(decorated_output_dist_q())[["histogram_plot"]])