From ec1ab3559f375433a9c168230e28b1b72fc136d2 Mon Sep 17 00:00:00 2001 From: hammadtheone Date: Tue, 18 May 2021 02:33:14 -0400 Subject: [PATCH] Fixing favicon bug --- CHANGELOG.md | 3 +++ R/dash.R | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aafcb2d0..e6369863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Unify the core Dash packages (dash, dashCoreComponents, dashHtmlComponents, dashTable) for streamlined maintenance and accessibility. The namespaces of these packages will be combined under the `dash` namespace, and all artifacts from the ancillary dash packages will be included with Dash for R. [#243](https://github.com/plotly/dashr/pull/243) +### Fixed +- Minor fix for favicon issue continued from [#240](https://github.com/plotly/dashr/pull/240) (for more details, see [#243](https://github.com/plotly/dashR/pull/243#issuecomment-842813526)). + ## [0.9.1] - 2020-11-16 ### Fixed - A regression which prevented favicons from displaying properly has been resolved, and a default Dash favicon is now supplied when none is provided in the `assets` directory. [#240](https://github.com/plotly/dashr/pull/240) diff --git a/R/dash.R b/R/dash.R index 32466353..afdbda42 100644 --- a/R/dash.R +++ b/R/dash.R @@ -500,8 +500,8 @@ Dash <- R6::R6Class( "/favicon.ico") # If custom favicon is not present, get the path for the default Dash favicon - if (is.na(names(asset_path))) { - asset_path <- system.file("extdata", "favicon.ico", package = "dash") + if (is.na(names(asset_path)) || is.null(asset_path)) { + asset_path <- setNames(system.file("extdata", "favicon.ico", package = "dash"), c("/favicon.ico")) } file_handle <- file(asset_path, "rb")