mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-01 11:20:58 -05:00
Use VITE_THEMES_URL
for the default theme manifest
- typed `ImportMeta` to have `env`
This commit is contained in:
parent
6d85c9b725
commit
6a32e451ac
2 changed files with 7 additions and 2 deletions
4
src/env.d.ts
vendored
4
src/env.d.ts
vendored
|
@ -2,3 +2,7 @@ interface ImportMetaEnv {
|
||||||
VITE_API_URL: string;
|
VITE_API_URL: string;
|
||||||
VITE_THEMES_URL: string;
|
VITE_THEMES_URL: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ImportMeta {
|
||||||
|
env: ImportMetaEnv
|
||||||
|
}
|
|
@ -5,10 +5,11 @@ import { Theme, generateVariables } from '../../../context/Theme'
|
||||||
import { dispatch } from "../../../redux"
|
import { dispatch } from "../../../redux"
|
||||||
|
|
||||||
export const fetchManifest = (): Promise<Manifest> =>
|
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> =>
|
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 {
|
interface ThemeMetadata {
|
||||||
name: string,
|
name: string,
|
||||||
|
|
Loading…
Reference in a new issue