Skip to content

Commit

Permalink
Fixed a bug where widget will try to load repository when data is not…
Browse files Browse the repository at this point in the history
… even loaded
  • Loading branch information
dipterix committed Sep 28, 2024
1 parent dcd0301 commit f5becf1
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ravedash
Type: Package
Title: Dashboard System for Reproducible Visualization of 'iEEG'
Version: 0.1.3.33
Version: 0.1.3.34
Authors@R: c(
person("Zhengjia", "Wang", email = "dipterix.wang@gmail.com", role = c("aut", "cre", "cph"))
)
Expand Down
14 changes: 13 additions & 1 deletion R/preset-analysis-electrode.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@ presets_analysis_electrode_selector2 <- function(

# repository_name <- "repository"
get_repo <- function(){
if(!comp$container$data[['@has']](pipeline_repository)) {

data_loaded <- isTRUE(shiny::isolate(watch_data_loaded()))
has_repository <- comp$container$data[['@has']](pipeline_repository)

if(!data_loaded) {
if( has_repository ) {
comp$container$data[["@remove"]](pipeline_repository)
}
return(NULL)
}

if(!has_repository) {
logger("Trying to get repository object...", level = "trace")
repository <- raveio::pipeline_read(var_names = pipeline_repository,
pipe_dir = comp$container$pipeline_path)
comp$container$data[[pipeline_repository]] <- repository
Expand Down
14 changes: 13 additions & 1 deletion R/preset-analysis-range.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,19 @@ presets_analysis_ranges <- function(
}

get_repo <- function(){
if(!comp$container$data[['@has']](pipeline_repository)) {

data_loaded <- isTRUE(shiny::isolate(watch_data_loaded()))
has_repository <- comp$container$data[['@has']](pipeline_repository)

if(!data_loaded) {
if( has_repository ) {
comp$container$data[["@remove"]](pipeline_repository)
}
return(NULL)
}

if(!has_repository) {
logger("Trying to get repository object...", level = "trace")
repository <- raveio::pipeline_read(var_names = pipeline_repository,
pipe_dir = comp$container$pipeline_path)
comp$container$data[[pipeline_repository]] <- repository
Expand Down
14 changes: 13 additions & 1 deletion R/preset-baseline-choices.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@ presets_baseline_choices <- function(

# repository_name <- "repository"
get_repo <- function(){
if(!comp$container$data[['@has']](pipeline_repository)) {

data_loaded <- isTRUE(shiny::isolate(watch_data_loaded()))
has_repository <- comp$container$data[['@has']](pipeline_repository)

if(!data_loaded) {
if( has_repository ) {
comp$container$data[["@remove"]](pipeline_repository)
}
return(NULL)
}

if(!has_repository) {
logger("Trying to get repository object...", level = "trace")
repository <- raveio::pipeline_read(var_names = pipeline_repository,
pipe_dir = comp$container$pipeline_path)
comp$container$data[[pipeline_repository]] <- repository
Expand Down
14 changes: 13 additions & 1 deletion R/preset-condition-groups.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ presets_condition_groups <- function(
# component_container$add_components(comp)

get_repo <- function(){
if(!comp$container$data[['@has']](pipeline_repository)) {

data_loaded <- isTRUE(shiny::isolate(watch_data_loaded()))
has_repository <- comp$container$data[['@has']](pipeline_repository)

if(!data_loaded) {
if( has_repository ) {
comp$container$data[["@remove"]](pipeline_repository)
}
return(NULL)
}

if(!has_repository) {
logger("Trying to get repository object...", level = "trace")
repository <- raveio::pipeline_read(var_names = pipeline_repository,
pipe_dir = comp$container$pipeline_path)
comp$container$data[[pipeline_repository]] <- repository
Expand Down
14 changes: 13 additions & 1 deletion R/preset-import-export-pipeline.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@ presets_import_export_subject_pipeline <- function(

# repository_name <- "repository"
get_repo <- function(){
if(!comp$container$data[['@has']](pipeline_repository)) {

data_loaded <- isTRUE(shiny::isolate(watch_data_loaded()))
has_repository <- comp$container$data[['@has']](pipeline_repository)

if(!data_loaded) {
if( has_repository ) {
comp$container$data[["@remove"]](pipeline_repository)
}
return(NULL)
}

if(!has_repository) {
logger("Trying to get repository object...", level = "trace")
repository <- raveio::pipeline_read(var_names = pipeline_repository,
pipe_dir = comp$container$pipeline_path)
comp$container$data[[pipeline_repository]] <- repository
Expand Down

0 comments on commit f5becf1

Please sign in to comment.