Skip to content

Commit 1daae23

Browse files
committed
Add warning for when bookmark is requested but it is disabled
1 parent 5b2db2a commit 1daae23

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

shiny/bookmark/_bookmark.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,16 @@ async def update_query_string(
444444
async def do_bookmark(self) -> None:
445445

446446
if self.store == "disable":
447+
# If you have a bookmark button or request a bookmark to be saved,
448+
# then it should be saved. (Present a warning telling author how to fix it)
449+
warnings.warn(
450+
"Saving the bookmark state has been requested. "
451+
'However, bookmarking is current set to `"disable"`. '
452+
"Please enable bookmarking by setting "
453+
"`shiny.App(bookmark_store=)` or "
454+
"`shiny.express.app_opts(bookmark_store=)`",
455+
stacklevel=2,
456+
)
447457
return
448458

449459
try:

0 commit comments

Comments
 (0)