Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 404 issue #125

Merged
merged 2 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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