diff --git a/src/components/modals/main/settings/sections/Weather.jsx b/src/components/modals/main/settings/sections/Weather.jsx index cfa40ab6..9a8cb955 100644 --- a/src/components/modals/main/settings/sections/Weather.jsx +++ b/src/components/modals/main/settings/sections/Weather.jsx @@ -29,7 +29,7 @@ export default class TimeSettings extends React.PureComponent { getAuto() { navigator.geolocation.getCurrentPosition(async (position) => { - const data = await (await fetch(`${window.constants.WEATHER_URL}/location?getAuto=true&lat=${position.coords.latitude}&lon=${position.coords.longitude}`)).json(); + const data = await (await fetch(`${window.constants.PROXY_URL}/weather/autolocation?lat=${position.coords.latitude}&lon=${position.coords.longitude}`)).json(); this.setState({ location: data[0].name }); diff --git a/src/components/widgets/background/Background.jsx b/src/components/widgets/background/Background.jsx index a8555d91..ea9232e9 100644 --- a/src/components/widgets/background/Background.jsx +++ b/src/components/widgets/background/Background.jsx @@ -148,10 +148,10 @@ export default class Background extends React.PureComponent { let requestURL, data; switch (backgroundAPI) { case 'unsplash': - requestURL = `${window.constants.UNSPLASH_URL}/images/random?quality=${apiQuality}`; + requestURL = `${window.constants.PROXY_URL}/images/unsplash?quality=${apiQuality}`; break; case 'pexels': - requestURL = `${window.constants.PEXELS_URL}/images/random?quality=${apiQuality}`; + requestURL = `${window.constants.PROXY_URL}/images/pexels?quality=${apiQuality}`; break; // Defaults to Mue default: diff --git a/src/components/widgets/weather/Weather.jsx b/src/components/widgets/weather/Weather.jsx index 8c9b4c7f..18a16b03 100644 --- a/src/components/widgets/weather/Weather.jsx +++ b/src/components/widgets/weather/Weather.jsx @@ -64,7 +64,7 @@ export default class Weather extends React.PureComponent { const tempFormat = localStorage.getItem('tempformat'); if (!this.state.weather.temp) { - data = await (await fetch(window.constants.WEATHER_URL + `/current?city=${this.state.location}&lang=${localStorage.getItem('language')}&format=${tempFormat}`)).json(); + data = await (await fetch(window.constants.PROXY_URL + `/weather/current?city=${this.state.location}&lang=${localStorage.getItem('language')}&format=${tempFormat}`)).json(); } if (data.cod === '404') { diff --git a/src/modules/constants.js b/src/modules/constants.js index c7eef005..e77058de 100644 --- a/src/modules/constants.js +++ b/src/modules/constants.js @@ -1,9 +1,7 @@ // API URLs export const API_URL = 'https://api.muetab.com'; -export const UNSPLASH_URL = 'https://unsplash.muetab.com'; -export const PEXELS_URL = 'https://pexels.muetab.com'; +export const PROXY_URL = 'https://proxy.muetab.com'; export const MARKETPLACE_URL = 'https://marketplace.muetab.com'; -export const WEATHER_URL = 'https://weather.muetab.com'; export const SPONSORS_URL = 'https://sponsors.muetab.com'; export const GITHUB_URL = 'https://api.github.com'; export const DDG_IMAGE_PROXY = 'https://external-content.duckduckgo.com/iu/?u=';