mirror of
https://github.com/ReVanced/revanced-website.git
synced 2026-01-10 21:26:18 +00:00
fix: Add default status URL value through environment variables
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
RV_API_URL=https://api.revanced.app
|
||||
RV_STATUS_URL=https://status.revanced.app
|
||||
RV_GOOGLE_TAG_MANAGER_ID=
|
||||
RV_DMCA_GUID=
|
||||
@@ -1,7 +1,8 @@
|
||||
import { browser } from '$app/environment';
|
||||
import { RV_API_URL } from '$env/static/public';
|
||||
import { RV_API_URL, RV_STATUS_URL } from '$env/static/public';
|
||||
|
||||
export const default_api_url = RV_API_URL;
|
||||
export const default_status_url = RV_STATUS_URL;
|
||||
|
||||
const URL_KEY = 'revanced_api_url';
|
||||
const STATUS_KEY = 'revanced_status_url';
|
||||
@@ -34,12 +35,12 @@ export function api_base_url(): string {
|
||||
return default_api_url;
|
||||
}
|
||||
|
||||
export function status_url(): string | null {
|
||||
export function status_url(): string {
|
||||
if (browser) {
|
||||
return localStorage.getItem(STATUS_KEY) || null;
|
||||
return localStorage.getItem(STATUS_KEY) || default_status_url;
|
||||
}
|
||||
|
||||
return null;
|
||||
return default_status_url;
|
||||
}
|
||||
|
||||
// (re)set base URL.
|
||||
|
||||
Reference in New Issue
Block a user