diff --git a/src/components/widgets/weather/icon.jsx b/src/components/widgets/weather/icon.jsx
index 1a250fbe..b6105254 100644
--- a/src/components/widgets/weather/icon.jsx
+++ b/src/components/widgets/weather/icon.jsx
@@ -3,7 +3,5 @@ import mapIcon from "utils/condition-map";
export default function Icon({ condition, timeOfDay }) {
const Icon = mapIcon(condition, timeOfDay);
- return (
-
- );
+ return ;
}
diff --git a/src/components/widgets/weather/weather.jsx b/src/components/widgets/weather/weather.jsx
index 7e42c17d..0308932d 100644
--- a/src/components/widgets/weather/weather.jsx
+++ b/src/components/widgets/weather/weather.jsx
@@ -1,40 +1,41 @@
import useSWR from "swr";
+import { BiError } from "react-icons/bi";
+
import Icon from "./icon";
export default function Weather({ options }) {
const { data, error } = useSWR(
- `/api/widgets/weather?lat=${options.latitude}&lon=${options.longitude}&apiKey=${options.apiKey}&duration=${options.cache}`,
- {
- revalidateOnFocus: false,
- revalidateOnReconnect: false,
- }
+ `/api/widgets/weather?lat=${options.latitude}&lon=${options.longitude}&apiKey=${options.apiKey}&duration=${options.cache}`
);
if (error) {
- return
failed to load
;
+ return (
+
+ );
}
if (!data) {
- return ;
+ return ;
}
if (data.error) {
- return ;
+ return ;
}
return (
-
+
- {Math.round(data.current.temp_f)}°
-
-
- {data.current.condition.text}
+ {options.units === "metric" ? data.current.temp_c : data.current.temp_f}°
+ {data.current.condition.text}
);