diff --git a/src/app/MainFile.java b/src/app/MainFile.java index 6d9a3c2..c83e72e 100644 --- a/src/app/MainFile.java +++ b/src/app/MainFile.java @@ -147,7 +147,7 @@ private static void setUpTempUser(InMemoryCurrentUserDAO currentUserDAO, FileUse GetCurrentUserViewModel getCurrentUserViewModel) throws IOException { CommonUserFactory userFactory = new CommonUserFactory(); CommonLocationFactory locationFactory = new CommonLocationFactory(); - Location temporaryLocation = locationFactory.makeLocation("(50,-75)"); + Location temporaryLocation = locationFactory.makeLocation("(43.664486,-79.399689)"); User temporaryUser = userFactory.create("username","123",5,"m","contact"); temporaryUser.setLocation(temporaryLocation); currentUserDAO.changeUser(temporaryUser); diff --git a/src/data_access/CoordinatesFromIP.java b/src/data_access/CoordinatesFromIP.java index e2e5d9f..ea15033 100644 --- a/src/data_access/CoordinatesFromIP.java +++ b/src/data_access/CoordinatesFromIP.java @@ -21,7 +21,7 @@ public class CoordinatesFromIP implements GetCoordinatesIP { * @throws IOException error occurs with the api call. Here, empty coordinates would be returned. */ @Override - public String[] getCoordinates() throws IOException { + public String[] getCoordinates() throws IOException { String[] result = {}; try { URL url = new URL("http://ip-api.com/csv/"); diff --git a/src/view/HomeView.java b/src/view/HomeView.java index 8311c5b..253c525 100644 --- a/src/view/HomeView.java +++ b/src/view/HomeView.java @@ -382,8 +382,7 @@ private void CreateEvent_BUTTONActionPerformed(java.awt.event.ActionEvent evt) t private void SearchEvent_BUTTONActionPerformed(java.awt.event.ActionEvent evt) throws IOException { if (evt.getSource().equals(SearchEvent_BUTTON)) { try { - LocationFactory factory = new CommonLocationFactory(); - Location userLocation = factory.makeLocation("(43.665510,-79.387280)"); + String[] userLocation = getCurrentUserViewModel.getState().getUserCoordinates(); searchNearbyController.execute(userLocation); } catch (IOException e) {