From e46933daa53ccf6745c795e5b3c8f1cc51be2403 Mon Sep 17 00:00:00 2001 From: pliablepixels Date: Thu, 4 Feb 2016 16:11:10 -0500 Subject: only show blog notifications for critical posts Former-commit-id: 1293779e9506d9c27ad6acdcb670512319273bd6 --- www/js/MontageHistoryCtrl.js | 4 ++-- www/js/app.js | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'www/js') diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index e4b2bbb5..2fd5b7de 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -285,7 +285,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc function controlEventStream(cmd, disp, connkey, ndx) { // console.log("Command value " + cmd); - + if (disp) { $ionicLoading.hide(); $ionicLoading.show({ @@ -358,7 +358,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc }); req.success(function (resp) { - //console.log("SUCCESS FOR: " + JSON.stringify(resp)); + console.log("SUCCESS FOR: " + JSON.stringify(resp)); if (resp.result=="Ok" && ndx != -1) { diff --git a/www/js/app.js b/www/js/app.js index 716104e7..d847eac9 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -441,6 +441,7 @@ angular.module('zmApp', [ var lastDate = $localstorage.get("latestBlogPostChecked"); if (!lastDate) { + $rootScope.newBlogPost="(new post)"; return; } @@ -451,8 +452,14 @@ angular.module('zmApp', [ if (mItemDate.diff(mLastDate) >0) { ZMDataModel.zmDebug("New post dated " + data[0].date + " found"); - $rootScope.newBlogPost = "(new post)"; - + if (data[0].level == "critical" ) + { + $rootScope.newBlogPost = "(new post)"; + } + else + { + ZMDataModel.zmDebug ("Not showing a notification in menu as this is not critical"); + } } else { -- cgit v1.2.3