diff --git a/R/precompiled.R b/R/precompiled.R index 645216150..d02762445 100644 --- a/R/precompiled.R +++ b/R/precompiled.R @@ -7,13 +7,14 @@ # theme so we can compare with the user theme. We only use the precompiled theme # if the two are identical. Themes are cached after comparison. precompiled_bs_theme_hash <- function(version) { - theme <- get0(version, .precompiled_css_themes) + theme_hash <- get0(version, .precompiled_css_themes) + if (is.null(theme)) { - theme <- rlang::hash(bs_theme(version = version, brand = FALSE)) - assign(version, theme, envir = .precompiled_css_themes) + theme_hash <- rlang::hash(bs_theme(version = version, brand = FALSE)) + assign(version, theme_hash, envir = .precompiled_css_themes) } - return(theme) + return(theme_hash) } #' Get the path to a precompiled CSS file