Use `VITE_THEMES_URL` for the default theme manifest
- typed `ImportMeta` to have `env`pull/1049/head
parent
659900d1a8
commit
b9dff190b0
|
|
@ -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