From b2161ce37a9de8ce3a8fdf856ba90dc05f158a2b Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Tue, 2 May 2017 17:30:24 +0200 Subject: [PATCH] If no home and there are some cities, load first city --- js/public/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/public/app.js b/js/public/app.js index 40733a2..9b93932 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -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();