1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-24 13:43:12 +02:00

Restoring mattermost favicon on leave focalboard (#948)

This commit is contained in:
Jesús Espino 2021-08-12 12:58:17 +02:00 committed by GitHub
parent 2aac030ee7
commit 4dc1c6db4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,6 +55,21 @@ const MainApp = () => {
}
}, [])
useEffect(() => {
const link = (document.querySelector("link[rel*='icon']") || document.createElement('link')) as HTMLLinkElement
const restoreData = {
type: link.type,
rel: link.rel,
href: link.href,
}
return () => {
link.type = restoreData.type
link.rel = restoreData.rel
link.href = restoreData.href
document.getElementsByTagName('head')[0].appendChild(link)
}
}, [])
return (
<ErrorBoundary>
<ReduxProvider store={store}>