Permalink
Browse files

Prevent double API call at first load.

  • Loading branch information...
1 parent e51e533 commit f98844fd71ed343ef2a7e5791f54d0a64898ff25 @st3fan committed Mar 30, 2013
Showing with 0 additions and 2 deletions.
  1. +0 −2 resources/public/index.js
@@ -172,14 +172,12 @@ app.controller('PredictionsController', function ($scope, $http, $timeout) {
$scope.title = "Departures"
navigator.geolocation.getCurrentPosition(function (position) {
location = {position: {latitude: position.coords.latitude, longitude: position.coords.longitude}};
- $scope.loadPredictions(location);
var refreshTimeout = $timeout($scope.onTimeout, 1000);
});
} else {
var name = window.location.hash.substr(1);
$scope.title = locations[name].title;
location = {name: name};
- $scope.loadPredictions(location);
var refreshTimeout = $timeout($scope.onTimeout, 1000);
}
});

0 comments on commit f98844f

Please sign in to comment.