diff --git a/bower.json b/bower.json index e2f5ef6f15b2013837ed01ad8e6a8581add0ea05..c6b24a737a138a69b0842f4bdb5e78f2e2ad32a5 100644 --- a/bower.json +++ b/bower.json @@ -14,7 +14,7 @@ "ionic-img-cache": "^1.1.1" }, "devDependencies": { - "platform.js": "platform#^1.3.3", + "platform.js": "platform#^1.3.4", "ionic-platform-web-client": "^0.7.1" } } diff --git a/www/js/modules/notification/service.js b/www/js/modules/notification/service.js index 7c0d7a703a032988387770c53abadd98b7dd6ab5..86f7d7dc4097f6d88a068cec831c45160f8bf347 100644 --- a/www/js/modules/notification/service.js +++ b/www/js/modules/notification/service.js @@ -36,7 +36,12 @@ if (typeof deviceData.token === 'undefined' || deviceData.token == null) { deviceData.token = 'tokenCannotBeCreated'; - } + } + + if (deviceData.token != 'tokenCannotBeCreated') { + window.FirebasePlugin.subscribe(locale); + console.log("Device has subscribed to " + locale + " topic") + } } else { //Mock deviceData diff --git a/www/js/pages/football-details/controller.js b/www/js/pages/football-details/controller.js index 62b22c398ef297fa425e067b6648c9aef1217b10..149aa1c0a03856b06e17ba11f7fe73bdba0079c4 100644 --- a/www/js/pages/football-details/controller.js +++ b/www/js/pages/football-details/controller.js @@ -62,7 +62,7 @@ prediction.prediction_win_second, prediction.prediction_draw ]; - percentages.sort(); + percentages.sort(function(a, b){return a-b}); if (percentages.indexOf(value) === 2) { return "main-prediction"; } else if (percentages.indexOf(value) === 1) { @@ -85,7 +85,7 @@ 'green-tick' ]; - percentages.sort(); + percentages.sort(function(a, b){return a-b}); var predictionWin = null; if (prediction.winner) { if (prediction.winner === -1) { diff --git a/www/js/pages/tennis-details/controller.js b/www/js/pages/tennis-details/controller.js index cd8363511209cbd60b1657d3f7d867854da04a31..8d97135530b3c2a21422c4e9f9f6e2e4213444aa 100644 --- a/www/js/pages/tennis-details/controller.js +++ b/www/js/pages/tennis-details/controller.js @@ -62,7 +62,7 @@ prediction.prediction_win_first, prediction.prediction_win_second ]; - percentages.sort(); + percentages.sort(function(a, b){return a-b}); if (percentages.indexOf(value) === 1) { return "main-prediction"; } @@ -81,7 +81,7 @@ 'green-tick' ]; - percentages.sort(); + percentages.sort(function(a, b){return a-b}); var predictionWin = null; if (prediction.winner) { predictionWin = prediction.prediction_win_second; diff --git a/www/partials/score/tennis.html b/www/partials/score/tennis.html index a8ffc579e6663378ffb159d70be0d57d63dd8cf6..5b77151a91c8990e51d8ca6f59ec6b9f7d66181a 100644 --- a/www/partials/score/tennis.html +++ b/www/partials/score/tennis.html @@ -1,3 +1,3 @@ -<div class="set" ng-repeat="set in freePrediction.score track by set"> +<div class="set" ng-repeat="set in freePrediction.score track by $index"> <span class="score-element" ng-repeat="score in set track by score">{{score}}</span> </div>