Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Commit

Permalink
fix favicon changing
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanVann committed Oct 13, 2020
1 parent b9a18ab commit 309acba
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/docs/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// This isn't important for the example, just nice.
const changeFavicon = (src) => {
const oldLink = document.querySelector('link[rel="icon"]')
document.head.removeChild(oldLink)
const link = document.createElement('link')
link.id = 'dynamic-favicon'
link.rel = 'icon'
link.type = 'image/png'
link.href = src
const oldLink = document.getElementById('dynamic-favicon')
if (oldLink) {
document.head.removeChild(oldLink)
}
document.head.appendChild(link)
}

Expand Down

0 comments on commit 309acba

Please sign in to comment.