Skip to content

Commit

Permalink
Merge pull request #125 from Appsilon/fix-404-issue
Browse files Browse the repository at this point in the history
Fix 404 issue
  • Loading branch information
jakubnowicki authored Mar 24, 2023
2 parents e36697b + 85741fe commit 7ecc3d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: shiny.router
Type: Package
Title: Basic Routing for Shiny Web Applications
Version: 0.3.0
Version: 0.3.0.9000
Authors@R:
c(
person("Ryszard", "Szymański", email = "[email protected]", role = c("cre", "aut")),
Expand Down
3 changes: 2 additions & 1 deletion R/router.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ create_router_callback <- function(root, routes = NULL) {
ignoreInit = FALSE,
# Shiny uses the "onhashchange" browser method (via JQuery) to detect
# changes to the hash
eventExpr = c(get_url_hash(session), session$clientData$url_search),
eventExpr = c(get_url_hash(session), session$clientData$url_search, input$routes),
handlerExpr = {
log_msg("hashchange observer triggered!")
new_hash <- shiny::getUrlHash(session)
Expand All @@ -141,6 +141,7 @@ create_router_callback <- function(root, routes = NULL) {
parsed$path <- ifelse(parsed$path == "", root, parsed$path)

is_path_valid <- if (is.null(routes)) {
shiny::req(input$routes)
log_msg("Valid paths:", input$routes)
!is.null(input$routes) && !(parsed$path %in% c(input$routes, "404"))
} else {
Expand Down

0 comments on commit 7ecc3d2

Please sign in to comment.