I am using shinymanager
to login a shiny app. Thanks to the this question, I am able to make the page fullscreen by adding an action button on my shiny app. However, I want the app to be fullscreen automatically after logging on the app.
I tried to use observeEvent()
wrt the user authentication as below;
auth <- secure_server( check_credentials = check_credentials(".\\cr\\db.sqlite"))
creds_reactive <- reactive({ auth$user })
observeEvent( auth$user, {
source(".\\funcs\\myfun.R", local = TRUE) # this works
js$toggleFullScreen() # not working
})
I am able to trigger a sourced function by using auth$user
in observeEvent()
, but the fullscreen function is not working.
However, I can trigger the very same function at the server side by clicking a button as below.
# Server side
onclick("my_full_screen_button", {
js$toggleFullScreen() # this works
})
# Ui side
tags$li(id="tam",class = "dropdown",
actionButton(icon = icon("expand-arrows-alt"), 'my_full_screen_button','',style="color: #fff; background-color: #888888; border-color: #888888") ),
I am suspecting that it stems from the jsToggleFS
. But I have almost no knowledge about JS.
Thank you in advance.