diff --git a/src/components/widget.jsx b/src/components/widget.jsx index 0dd26535..72032b44 100644 --- a/src/components/widget.jsx +++ b/src/components/widget.jsx @@ -1,9 +1,10 @@ -import Weather from "components/widgets/weather/weather"; +import WeatherApi from "components/widgets/weather/weather"; import OpenWeatherMap from "components/widgets/openweathermap/weather"; import Resources from "components/widgets/resources/resources"; const widgetMappings = { - weather: Weather, + weather: WeatherApi, // This key will be deprecated in the future + weatherapi: WeatherApi, openweathermap: OpenWeatherMap, resources: Resources, }; diff --git a/src/components/widgets/openweathermap/weather.jsx b/src/components/widgets/openweathermap/weather.jsx index 43edc091..893eb3bd 100644 --- a/src/components/widgets/openweathermap/weather.jsx +++ b/src/components/widgets/openweathermap/weather.jsx @@ -8,33 +8,48 @@ export default function OpenWeatherMap({ options }) { `/api/widgets/openweathermap?lat=${options.latitude}&lon=${options.longitude}&apiKey=${options.apiKey}&duration=${options.cache}&units=${options.units}` ); - if (error) { + if (error || data?.cod == 401) { return ( -