Skip to content
Snippets Groups Projects
Verified Commit 817f9916 authored by Théo Pirkl's avatar Théo Pirkl :nail_care:
Browse files

Fix brain

parent d6d3cf27
No related branches found
No related tags found
1 merge request!21*poof* final version
......@@ -283,8 +283,10 @@ public class MainWindowController implements Initializable {
Integer pos = Integer.parseInt(pnl.getId());
WeatherAPI api = new WeatherAPI();
Connection connection = displayedConnections.get(pos);
System.out.println(connection.getTo().getLocation().getCoordinates());
if (!(currentJourney instanceof Connection.EmptyConnection)){
leaveJourney(app, api.getWeatherFrom(connection.getTo().toString()).getConditions());
leaveJourney(app, api.getWeatherFrom(connection.getTo().getLocation().getCoordinates()).getConditions());
}
String weather = api.getWeatherFrom(connection.getTo().toString()).getConditions();
......@@ -307,7 +309,7 @@ public class MainWindowController implements Initializable {
Optional<ButtonType> result = alert.showAndWait();
if (result.get().equals(oui)){
try {
leaveJourney(app, api.getWeatherFrom(connection.getTo().toString()).getConditions());
leaveJourney(app, api.getWeatherFrom(connection.getTo().getLocation().getCoordinates()).getConditions());
} catch (IOException e) {
showSadMessage(AppConfig.ERROR_API_MQ);
e.printStackTrace();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment