COSC481W-2024Winter / JARVIS

J.A.R.V.I.S
2 stars 3 forks source link

Fix weather UI for city names with two words #71

Closed Luna-Jia closed 7 months ago

Luna-Jia commented 7 months ago

Retrieve weather condition and temperature directly from JSON response

This refactoring improves the code by retrieving the weather condition and temperature directly from the JSON response returned by the OpenWeatherMap API. It eliminates the need for string splitting and provides a more structured way of accessing the weather data.

The fetchWeather method now returns a map with the relevant weather information, which can be easily accessed in the _buildWeatherButton method to update the UI state.

issue #54