Skip to content

Commit

Permalink
chore: improve loading of shinytest2 js
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Nov 15, 2023
1 parent fbf5a0c commit 75b89ac
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions inst/apps/317-bslib-preset-shiny-dashboard/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ toggle_class_buttons <- HTML('
<label class="form-check-label" for="shadow_lg_toggle">Large Shadow Class</label>
</div>
</fieldset>
<script>document.querySelectorAll(".body-class-toggle").forEach((el) => {
el.checked = document.body.classList.contains(el.dataset.class)
})</script>
')


Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ nav_to_variant <- function(app, ...) {
url <- sprintf("%s?%s", app$get_url(), params)
chrm <- app$get_chromote_session()

p <- chrm$Page$navigate(url, wait_ = FALSE)$
then(function(...) chrm$Page$loadEventFired(wait_ = FALSE))$
p <- chrm$Page$loadEventFired(wait_ = FALSE)$
then(function(...) chrm$Runtime$evaluate(shinytest2_js, wait_ = FALSE))$
then(function(...) app$wait_for_idle())

chrm$Page$navigate(url, wait_ = FALSE)
chrm$wait_for(p)
invisible(app)
}
Expand Down

0 comments on commit 75b89ac

Please sign in to comment.