putting default values for manifest and icon in app.tsx

This commit is contained in:
Carter 2025-02-28 12:06:52 -06:00
parent 3a953ede85
commit 81e98da93e
2 changed files with 15 additions and 4 deletions

View file

@ -19,7 +19,7 @@
} }
], ],
"start_url": "/", "start_url": "/",
"theme_color": "#005bb0", "theme_color": "#272727",
"background_color": "#424242", "background_color": "#424242",
"display": "standalone", "display": "standalone",
"orientation": "any" "orientation": "any"

View file

@ -21,14 +21,25 @@ function App() {
fetch(manifestPath).then(response => { fetch(manifestPath).then(response => {
if (response.ok && manifestDocument) { if (response.ok && manifestDocument) {
manifestDocument.href = manifestPath; manifestDocument.href = manifestPath;
} else {
manifestDocument.href = "BrandXTechnologies/manifest.json"
} }
}).catch(() => {
manifestDocument.href = "BrandXTechnologies/manifest.json"
}) })
// Set favicon // Set favicon
const faviconDocument = document.getElementById("favicon-link") as HTMLLinkElement; const faviconDocument = document.getElementById("favicon-link") as HTMLLinkElement;
if (faviconDocument) { const faviconPath = `${whiteLabel.name.replace(/\s/g, "")}/favicon.ico`;
faviconDocument.href = `${whiteLabel.name.replace(/\s/g, "")}/favicon.ico`; fetch(faviconPath).then(response => {
if (response.ok && faviconDocument) {
faviconDocument.href = faviconPath;
} else {
faviconDocument.href = "BrandXTechnologies/favicon.ico"
} }
}).catch(() => {
faviconDocument.href = "BrandXTechnologies/favicon.ico"
})
let url: string | undefined = import.meta.env.VITE_AUTH0_CLIENT_DOMAIN; let url: string | undefined = import.meta.env.VITE_AUTH0_CLIENT_DOMAIN;
let audience: string | undefined = import.meta.env.VITE_AUTH0_AUDIENCE; let audience: string | undefined = import.meta.env.VITE_AUTH0_AUDIENCE;