deletet state
This commit is contained in:
@@ -9,7 +9,6 @@ import { X } from "lucide-react";
|
||||
|
||||
const WeatherCard: React.FC = () => {
|
||||
const [city, setCity] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [weatherData, setWeatherData] = useState(false);
|
||||
const getAPIKey = () => Cookies.get("apiKey") || "";
|
||||
const getUnit = () => localStorage.getItem("unit") || "metric";
|
||||
@@ -20,7 +19,6 @@ const WeatherCard: React.FC = () => {
|
||||
|
||||
const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
setLoading(true);
|
||||
toast
|
||||
.promise(fetchWeather(city, getAPIKey(), getUnit()), {
|
||||
pending: "Fetching weather data...",
|
||||
@@ -34,7 +32,6 @@ const WeatherCard: React.FC = () => {
|
||||
} else {
|
||||
setWeatherData(false);
|
||||
}
|
||||
setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user