Skip to content

Commit

Permalink
stop app when user "X"es out
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Oct 10, 2024
1 parent 2b1ea5c commit 6ef104b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/gadget.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.pal <- function() {
pal_fn <- .pal_app()
if (identical(pal_fn, "rs_pal_")) {
if (is.null(pal_fn) || identical(pal_fn, "rs_pal_")) {
return(NULL)
}
try_fetch(
Expand Down Expand Up @@ -41,6 +41,9 @@
shiny::observeEvent(input$done, {
shiny::stopApp(returnValue = paste0("rs_pal_", input$pal))
})
shiny::onStop(function() {
shiny::stopApp(returnValue = NULL)
})
}

viewer <- shiny::dialogViewer("Pal", width = 300, height = 10)
Expand Down

0 comments on commit 6ef104b

Please sign in to comment.