Don't try to load a local site config in development mode

This commit is contained in:
nexy7574 2024-12-15 20:07:47 +00:00
parent 5ea2d15964
commit a3331531b3
No known key found for this signature in database

View file

@ -6,7 +6,7 @@ import { trimTrailingSlash } from '../utils/common';
const getClientConfig = async (): Promise<ClientConfig> => {
let url = `${trimTrailingSlash(import.meta.env.BASE_URL)}/config.${window.location.hostname}.json`;
let config = await fetch(url, { method: 'GET' });
if(config.status===404) {
if(config.status===404 || import.meta.env.MODE==="development") {
url = `${trimTrailingSlash(import.meta.env.BASE_URL)}/config.json`;
config = await fetch(url, { method: 'GET' });
}