forked from abner/for-legacy-web
Use `VITE_THEMES_URL` for the default theme manifest
- typed `ImportMeta` to have `env`ui/bot-profile
parent
6d85c9b725
commit
6a32e451ac
|
|
@ -2,3 +2,7 @@ interface ImportMetaEnv {
|
|||
VITE_API_URL: string;
|
||||
VITE_THEMES_URL: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
env: ImportMetaEnv
|
||||
}
|
||||
|
|
@ -5,10 +5,11 @@ import { Theme, generateVariables } from '../../../context/Theme'
|
|||
import { dispatch } from "../../../redux"
|
||||
|
||||
export const fetchManifest = (): Promise<Manifest> =>
|
||||
fetch(`//bree.dev/revolt-themes/manifest.json`).then(res => res.json())
|
||||
fetch(`${import.meta.env.VITE_THEMES_URL}/manifest.json`).then(res => res.json())
|
||||
|
||||
export const fetchTheme = (slug: string): Promise<Theme> =>
|
||||
fetch(`//bree.dev/revolt-themes/theme_${slug}.json`).then(res => res.json())
|
||||
fetch(`${import.meta.env.VITE_THEMES_URL}/theme_${slug}.json`).then(res => res.json())
|
||||
|
||||
|
||||
interface ThemeMetadata {
|
||||
name: string,
|
||||
|
|
|
|||
Loading…
Reference in New Issue