From e8d09233658e732d226550d218e3868c4c604446 Mon Sep 17 00:00:00 2001 From: marchingon12 Date: Thu, 23 May 2024 22:43:21 +0200 Subject: [PATCH] Revert "revert: Revert to proxy method for fdroid fetching" This reverts commit ac0b5e606b6572bd4b5889408ebbbe15ca1141b7. --- src/lib/fetch.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/fetch.js b/src/lib/fetch.js index 49ecbf8..95a61c3 100644 --- a/src/lib/fetch.js +++ b/src/lib/fetch.js @@ -73,9 +73,11 @@ export function FdroidFetch() { const [myneApkFdroidUrl, setMyneApkFdroidUrl] = useState(''); const [greenStashApkFdroidUrl, setGreenStashApkFdroidUrl] = useState(''); + useEffect(() => { const fetchApkUrl = (packageName) => { - return axios.get(`/fdroid/packages/${packageName}`).then((response) => { + const baseURL = import.meta.env.MODE === 'production' ? 'https://f-droid.org/api/v1' : '/fdroid'; + return axios.get(`${baseURL}/packages/${packageName}`).then((response) => { console.log('Response data:', response.data); const latestPackage = response.data; if (!latestPackage) {