Skip to content

Commit

Permalink
really wild workaround for shiny bug
Browse files Browse the repository at this point in the history
  • Loading branch information
werpuc committed May 21, 2020
1 parent 2e06f8c commit ecdbd8a
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
59 changes: 59 additions & 0 deletions inst/HaDeX/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,65 @@ server <- function(input, output, session) {

##

observe({

tryCatch({
if(input[["deut_concentration"]] < 0)
updateNumericInput(session,
inputId = "deut_concentration",
value = 0)
}, error = function(e){
updateNumericInput(session,
inputId = "deut_concentration",
value = 0)
})
})

observe({

tryCatch({
if(input[["deut_concentration"]] > 100)
updateNumericInput(session,
inputId = "deut_concentration",
value = 100)
},
error = function(e){
updateNumericInput(session,
inputId = "deut_concentration",
value = 100)
})

})

observe({

tryCatch({
if(input[["sequence_length"]] < max_range())
updateNumericInput(session,
inputId = "sequence_length",
value = max_range())
},
error = function(e){
updateNumericInput(session,
inputId = "sequence_length",
value = max_range())
})

})

observe({

tryCatch(
{ if(input[["sequence_start_shift"]] < 0)
updateNumericInput(session,
inputId = "sequence_start_shift",
value = 1) },
error = function(e) {
message("You cannot shift it to minus values!")
updateNumericInput(session,
inputId = "sequence_start_shift",
value = 1) })
})

##

Expand Down
2 changes: 1 addition & 1 deletion inst/HaDeX/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ui <- fluidPage(theme = "HaDeX_theme.css",
inputId = "data_file",
label = "Choose file:",
multiple = FALSE,
accept = c(".csv", ".xslx", ".xsl"),
accept = c(".csv", ".xlsx", ".xls"),
placeholder = "No file selected")),
column(4,
h5("File status:"),
Expand Down

0 comments on commit ecdbd8a

Please sign in to comment.