diff --git a/examples/python/app.py b/examples/python/app.py index 398e0fa..867d831 100644 --- a/examples/python/app.py +++ b/examples/python/app.py @@ -48,8 +48,9 @@ def param(): @reactive.effect async def redirect(): - input.click() - # await session.send_custom_message("_shiny_router_change_url", {"url": "elo"}) + counter = input.click() + if counter: + await session.send_custom_message("_shiny_router_change_url", {"url": "elo"}) app = App(app_ui, server) \ No newline at end of file diff --git a/inst/www/shiny.router.js b/inst/www/shiny.router.js index df73923..3a1b720 100644 --- a/inst/www/shiny.router.js +++ b/inst/www/shiny.router.js @@ -62,4 +62,4 @@ const change_url = function(message) { window.location.hash = url; } -Shiny.addCustomMessageHandler("_shiny_router_change_url", change_url); +Shiny.addCustomMessageHandler("_shiny_router_change_url", change_url); \ No newline at end of file diff --git a/uv.lock b/uv.lock index 52813cf..70c5c55 100644 --- a/uv.lock +++ b/uv.lock @@ -376,7 +376,7 @@ wheels = [ [[package]] name = "shiny-router" -version = "0.1.14" +version = "0.1.15" source = { virtual = "." } dependencies = [ { name = "pandas" },