Skip to content

Commit c58ac63

Browse files
authored
Merge pull request #54 from ilarischeinin/quit-button
Add a quit button to the shiny app user interface
2 parents 2e37649 + b78612e commit c58ac63

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

R/shiny-server.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ vdiffrServer <- function(cases) {
2727
validateSingleCase(input, cases)
2828

2929
output$status <- renderStatus(input, cases)
30+
31+
quitApp(input)
3032
})
3133
}
3234

@@ -199,3 +201,11 @@ renderStatus <- function(input, reactive_cases) {
199201
list(shiny::br(), paragraph)
200202
})
201203
}
204+
205+
quitApp <- function(input) {
206+
shiny::observe({
207+
if (input$quit_button > 0) {
208+
shiny::stopApp()
209+
}
210+
})
211+
}

R/shiny-ui.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ sidebarPanel <- function() {
2121
shiny::uiOutput("case_controls"),
2222
shiny::actionButton("case_validation_button", "Validate this"),
2323
shiny::uiOutput("status"),
24-
shiny::uiOutput("diff_text_controls")
24+
shiny::uiOutput("diff_text_controls"),
25+
shiny::br(),
26+
shiny::actionButton("quit_button", "Quit")
2527
)
2628
}
2729

0 commit comments

Comments
 (0)