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}>