Skip to content

Commit f6263cd

Browse files
committed
refactor: unnest renderUI
1 parent 50b19a5 commit f6263cd

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

app/view/mod_logs.R

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,17 @@ server <- function(id, selected_app_, selected_job_) {
7070
}
7171
)
7272

73-
observeEvent(selected_job_()$key, {
74-
req(selected_job_()$key)
75-
output$download_logs <- renderUI({
76-
downloadButton(
77-
outputId = ns("download"),
78-
label = NULL,
79-
icon = icon("download"),
80-
class = "logs-download"
81-
)
82-
})
73+
output$download_logs <- renderUI({
74+
if (is.null(selected_job_()$key)) {
75+
return(NULL)
76+
}
77+
78+
downloadButton(
79+
outputId = ns("download"),
80+
label = NULL,
81+
icon = icon("download"),
82+
class = "logs-download"
83+
)
8384
})
8485

8586
logs_data <- reactive({

0 commit comments

Comments
 (0)