fixed favicon not rendering when not visiting base url
This commit is contained in:
parent
b8d9733d1d
commit
85b184ce5e
1 changed files with 4 additions and 3 deletions
|
|
@ -17,7 +17,7 @@ function App() {
|
|||
const whiteLabel = getWhitelabel()
|
||||
const manifestPath = "/" + whiteLabel.name.replace(/\s/g, "") + "/manifest.json"
|
||||
const manifestDocument = document.getElementById('manifest-link') as HTMLLinkElement
|
||||
|
||||
console.log(manifestPath)
|
||||
fetch(manifestPath).then(response => {
|
||||
if (response.ok && manifestDocument) {
|
||||
manifestDocument.href = manifestPath;
|
||||
|
|
@ -30,12 +30,13 @@ function App() {
|
|||
|
||||
// Set favicon
|
||||
const faviconDocument = document.getElementById("favicon-link") as HTMLLinkElement;
|
||||
const faviconPath = `${whiteLabel.name.replace(/\s/g, "")}/favicon.ico`;
|
||||
const faviconPath = `/${whiteLabel.name.replace(/\s/g, "")}/favicon.ico`;
|
||||
fetch(faviconPath).then(response => {
|
||||
console.log("response ok: " + response.ok)
|
||||
if (response.ok && faviconDocument) {
|
||||
faviconDocument.href = faviconPath;
|
||||
} else {
|
||||
faviconDocument.href = "BrandXTechnologies/favicon.ico"
|
||||
faviconDocument.href = "/BrandXTechnologies/favicon.ico"
|
||||
}
|
||||
}).catch(() => {
|
||||
faviconDocument.href = "BrandXTechnologies/favicon.ico"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue