mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
Use VITE_THEMES_URL for the default theme manifest
- typed `ImportMeta` to have `env`
This commit is contained in:
4
src/env.d.ts
vendored
4
src/env.d.ts
vendored
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user