diff options
| author | Fuwn <[email protected]> | 2024-01-08 15:27:28 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-01-08 15:27:28 -0800 |
| commit | 6620bc00fdf5173ffb20a9057a4580b59410dbd7 (patch) | |
| tree | 57f149d20ce28960909bda1bba1d6fcbbd0ef515 /src/lib/Utility | |
| parent | fix(badges): loading order (diff) | |
| download | due.moe-6620bc00fdf5173ffb20a9057a4580b59410dbd7.tar.xz due.moe-6620bc00fdf5173ffb20a9057a4580b59410dbd7.zip | |
feat(tools): new tools url method
Diffstat (limited to 'src/lib/Utility')
| -rw-r--r-- | src/lib/Utility/proxy.ts | 4 | ||||
| -rw-r--r-- | src/lib/Utility/root.ts | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/Utility/proxy.ts b/src/lib/Utility/proxy.ts index ec9c289b..3337fe29 100644 --- a/src/lib/Utility/proxy.ts +++ b/src/lib/Utility/proxy.ts @@ -1,7 +1,7 @@ import { env } from '$env/dynamic/public'; -export const proxy = (url: string, disable = true) => - env.PUBLIC_ANILIST_REDIRECT_URI?.includes('192.168') && !disable +export const proxy = (url: string, enable = false) => + env.PUBLIC_ANILIST_REDIRECT_URI?.includes('localhost') || enable ? url : `https://proxy.due.moe/?q=${url}`; diff --git a/src/lib/Utility/root.ts b/src/lib/Utility/root.ts new file mode 100644 index 00000000..3f9ea07d --- /dev/null +++ b/src/lib/Utility/root.ts @@ -0,0 +1,8 @@ +import { env } from '$env/dynamic/public'; + +export const root = (path: string, enable = false) => + env.PUBLIC_ANILIST_REDIRECT_URI?.includes('localhost') || enable + ? `http://localhost:5173${path}` + : `https://due.moe${path}`; + +export default root; |