RinteRface/shinyMobile

Icon not displayed in reconnect / reload toaster

Closed this issue · 1 comments

Thanks for providing a very nice package!

I'm having the issue that the bolt icon is not displayed when there is a disconnect and the RECONNECT / RELOAD toaster comes up. Instead the name bolt_fill shows up in really big font (see screenshot attached).

I'm having the same issue both locally (forcing a disconnect) and on shinyapps.io and on heroku. In all cases, version 0.9.1 is used. I have also confirmed that the icon does exist, because I can use it in other elements.

Skärmbild 2022-01-28 140339

Here is a minimal example:

library(shiny)
library(shinyMobile)

shinyApp(
    ui = f7Page(
        title = "",
        f7SingleLayout(
            navbar = f7Navbar(title = ""),
            
            actionButton("kill", "Kill me!")
        )
    ),
    server = function(input, output) {
        observeEvent(input$kill, { stop() })
    }
)

If I start this app in the browser and then press the button, the bolt icon will not display properly, as described above.

This is due to missing dependencies:

$("head")
    .find("[type='application/html-dependencies']")
    .html()
    .split(";")
    .indexOf("f7-icons[3.0.0]")

-1

The JS code responsible for the notification does not ship f7 icon deps if there is no icon in the page. I should add a check to avoid this situation.