If no home and there are some cities, load first city

master
Loic Blot 2017-05-02 17:30:24 +02:00
parent 992378f166
commit b2161ce37a
1 changed files with 6 additions and 0 deletions

View File

@ -167,6 +167,12 @@ app.controller('WeatherController', ['$scope', '$interval', '$timeout', '$compil
}
}
}
// If no home found, load first city found
if ($scope.cities.length > 0) {
$scope.loadCity($scope.cities[0]);
}
},
function (r) {
$scope.fatalError();