@@ -614,7 +614,11 @@ Dash <- R6::R6Class(
614
614
# this calls getAppPath, which will try three approaches to
615
615
# identifying the local app path (depending on whether the app
616
616
# is invoked via script, source(), or executed directly from console)
617
- private $ app_root_modtime <- modtimeFromPath(private $ app_root_path )
617
+ private $ app_root_modtime <- as.integer(
618
+ max(
619
+ file.info(
620
+ list.files(getAppPath(),
621
+ recursive = TRUE ))$ mtime ))
618
622
619
623
if (is.null(dev_tools_ui ) && debug || isTRUE(dev_tools_ui )) {
620
624
self $ config $ ui <- TRUE
@@ -653,11 +657,13 @@ Dash <- R6::R6Class(
653
657
if (self $ config $ hot_reload == TRUE && file.exists(file.path(getAppPath(), " assets" ))) {
654
658
self $ server $ on(' cycle-end' , function (server , ... ) {
655
659
current_asset_modtime <- modtimeFromPath(private $ assets_folder )
656
- current_root_modtime <- modtimeFromPath(getAppPath())
657
-
660
+ current_root_modtime <- modtimeFromPath(getAppPath(), recursive = TRUE )
661
+
658
662
updated_assets <- isTRUE(current_asset_modtime > private $ asset_modtime )
659
663
updated_root <- isTRUE(current_root_modtime > private $ app_root_modtime )
660
-
664
+
665
+ private $ app_root_modtime <- current_root_modtime
666
+
661
667
initiate_reload <- isTRUE((as.integer(Sys.time()) - private $ last_reload ) > self $ config $ hot_reload_interval )
662
668
663
669
if (! is.null(private $ asset_modtime ) && initiate_reload && (updated_assets || updated_root )) {
@@ -669,7 +675,6 @@ Dash <- R6::R6Class(
669
675
private $ modified_since_reload <- updatedFiles $ modified
670
676
671
677
private $ asset_modtime <- current_asset_modtime
672
- private $ app_root_modtime <- current_root_modtime
673
678
# update the hash passed back to the renderer, and bump the timestamp
674
679
# to match the current reloading event
675
680
private $ updateReloadHash()
@@ -702,7 +707,10 @@ Dash <- R6::R6Class(
702
707
})
703
708
704
709
if (! self $ config $ running && file.exists(file.path(getAppPath(), " app.R" )))
710
+ {
705
711
source(file.path(getAppPath(), " app.R" ))
712
+ private $ index()
713
+ }
706
714
else {
707
715
self $ config $ running <- TRUE
708
716
self $ server $ ignite(block = block , showcase = showcase , ... )
0 commit comments