Skip to content
Snippets Groups Projects
Unverified Commit d8637361 authored by Todor Kondic's avatar Todor Kondic
Browse files

Update calls to validate

* R/shiny-ui-config.R<validate>: Change validations of one condition
  to validate1.
parent a0b38490
No related branches found
No related tags found
No related merge requests found
...@@ -135,7 +135,7 @@ react_conf_f <- function(input,output,session,rv,rf) { ...@@ -135,7 +135,7 @@ react_conf_f <- function(input,output,session,rv,rf) {
vls <- vols()() #Ugly! :) vls <- vols()() #Ugly! :)
vol <- path2vol(path) vol <- path2vol(path)
sel<-match(vol,vls) sel<-match(vol,vls)
validate(sel,msg="Yikes! Unable to detect current project's volume.") validate1(sel,msg="Yikes! Unable to detect current project's volume.")
res<-names(vls)[[sel]] res<-names(vls)[[sel]]
res res
}) })
...@@ -178,16 +178,17 @@ server_conf <- function(input,output,session,rv,rf) { ...@@ -178,16 +178,17 @@ server_conf <- function(input,output,session,rv,rf) {
conf<-rv_conf2conf(rv) conf<-rv_conf2conf(rv)
vol <- vol_f() vol <- vol_f()
fn <- shinyFiles::parseSavePath(roots=vol_f,input$saveConfB)[["datapath"]] fn <- shinyFiles::parseSavePath(roots=vol_f,input$saveConfB)[["datapath"]]
validate(fn,msg="Invalid file to save config to.") validate1(fn,msg="Invalid file to save config to.")
write_conf(conf,fn) write_conf(conf,fn)
}) })
obsrv_e(input$restoreConfB,{ obsrv_e(input$restoreConfB,{
fn <- shinyFiles::parseSavePath(roots=vol_f,input$saveConfB)[["datapath"]] fn <- shinyFiles::parseSavePath(roots=vol_f,input$saveConfB)[["datapath"]]
validate(fn,msg="Something went wrong with the config file name.") validate(need())
validate(file.exists(fn),msg="The file is unreadable.") validate1(fn,msg="Something went wrong with the config file name.")
validate1(file.exists(fn),msg="The file is unreadable.")
conf <- read_conf(fn) conf <- read_conf(fn)
rv <- vonf2rv_conf(conf,rv) rv <- conf2rv_conf(conf,rv)
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment