fixed bug: Error handling when submitting form with wrong api key
This commit is contained in:
@@ -23,8 +23,6 @@ const WeatherCard: React.FC = () => {
|
|||||||
.promise(fetchWeather(city, getAPIKey(), getUnit()), {
|
.promise(fetchWeather(city, getAPIKey(), getUnit()), {
|
||||||
pending: "Fetching weather data...",
|
pending: "Fetching weather data...",
|
||||||
success: "Weather data loaded successfully!",
|
success: "Weather data loaded successfully!",
|
||||||
error:
|
|
||||||
"Failed to load weather data. Please check your entered city name. (Error: x4040)",
|
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (localStorage.getItem("weather")) {
|
if (localStorage.getItem("weather")) {
|
||||||
|
Reference in New Issue
Block a user