@@ -647,21 +647,28 @@ Dash <- R6::R6Class(
647
647
}
648
648
649
649
getServerParam <- function (value , type , default ) {
650
+ if (toupper(value ) %in% c(" TRUE" , " FALSE" ))
651
+ value <- as.logical(toupper(value ))
650
652
if (value != " " && length(value ) != 0 && mode(value ) == type && ! is.na(value )) {
651
653
return (value )
652
654
} else {
653
655
return (default )
654
656
}
655
657
}
656
-
658
+
659
+ debug <- getServerParam(debug , " logical" , FALSE )
660
+ private $ debug <- debug
661
+
657
662
self $ server $ host <- getServerParam(host , " character" , " 127.0.0.1" )
658
663
self $ server $ port <- getServerParam(as.integer(port ), " numeric" , 8050 )
659
664
660
- dev_tools_ui <- getServerParam(dev_tools_ui , " logical" , NULL )
661
- dev_tools_props_check <- getServerParam(dev_tools_props_check , " logical" , NULL )
662
-
663
- debug <- getServerParam(debug , " logical" , FALSE )
664
-
665
+ dev_tools_ui <- getServerParam(dev_tools_ui , " logical" , debug )
666
+ dev_tools_props_check <- getServerParam(dev_tools_props_check , " logical" , debug )
667
+ dev_tools_silence_routes_logging <- getServerParam(dev_tools_silence_routes_logging , " logical" , debug )
668
+ dev_tools_hot_reload <- getServerParam(dev_tools_hot_reload , " logical" , debug )
669
+
670
+ private $ prune_errors <- getServerParam(dev_tools_prune_errors , " logical" , TRUE )
671
+
665
672
if (getAppPath() != FALSE ) {
666
673
source_dir <- dirname(getAppPath())
667
674
private $ app_root_modtime <- modtimeFromPath(source_dir , recursive = TRUE , asset_path = private $ assets_folder )
@@ -673,13 +680,9 @@ Dash <- R6::R6Class(
673
680
# this calls getAppPath, which will try three approaches to
674
681
# identifying the local app path (depending on whether the app
675
682
# is invoked via script, source(), or executed dire ctly from console)
676
- if (is.null(dev_tools_ui ) && debug || isTRUE(dev_tools_ui )) {
677
- self $ config $ ui <- TRUE
678
- } else {
679
- self $ config $ ui <- FALSE
680
- }
683
+ self $ config $ ui <- dev_tools_ui
681
684
682
- if (is.null( dev_tools_hot_reload ) && debug || isTRUE( dev_tools_hot_reload ) ) {
685
+ if (dev_tools_hot_reload ) {
683
686
hot_reload <- TRUE
684
687
hot_reload_interval <- getServerParam(dev_tools_hot_reload_interval , " numeric" , 3 )
685
688
hot_reload_watch_interval <- getServerParam(dev_tools_hot_reload_watch_interval , " numeric" , 0.5 )
@@ -690,20 +693,8 @@ Dash <- R6::R6Class(
690
693
hot_reload <- FALSE
691
694
}
692
695
693
- if (is.null(dev_tools_silence_routes_logging ) && debug || isTRUE(dev_tools_silence_routes_logging )) {
694
- self $ config $ silence_routes_logging <- TRUE
695
- } else {
696
- self $ config $ silence_routes_logging <- FALSE
697
- }
698
-
699
- if (is.null(dev_tools_props_check ) && debug || isTRUE(dev_tools_props_check )) {
700
- self $ config $ props_check <- TRUE
701
- } else {
702
- self $ config $ props_check <- FALSE
703
- }
704
-
705
- private $ prune_errors <- getServerParam(dev_tools_prune_errors , " logical" , TRUE )
706
- private $ debug <- debug
696
+ self $ config $ silence_routes_logging <- dev_tools_silence_routes_logging
697
+ self $ config $ props_check <- dev_tools_props_check
707
698
708
699
if (hot_reload == TRUE & ! (is.null(source_dir ))) {
709
700
self $ server $ on(' cycle-end' , function (server , ... ) {
0 commit comments