summaryrefslogtreecommitdiff
path: root/www/js/NewsCtrl.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2016-08-01 16:43:27 -0400
committerPliable Pixels <pliablepixels@gmail.com>2016-08-01 16:43:27 -0400
commit69e7033fca28646d1f3f2c78db6e0e6c2796c3e8 (patch)
treedc9cb04aeaaf961e776645b656a9f4dc4e457025 /www/js/NewsCtrl.js
parent81d24bbed0af0ba7b39948ca968528b225a46c76 (diff)
#292 - various items cleaned up, default to sqlite for devices, cleaned up entry paths to PortalLogin and ensured its AFTER DataModel.init() - wonder if this fixes #193
Former-commit-id: fbe5c0b0649b44912f5a52babeea5aa91a58e70f
Diffstat (limited to 'www/js/NewsCtrl.js')
-rw-r--r--www/js/NewsCtrl.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/www/js/NewsCtrl.js b/www/js/NewsCtrl.js
index a0ab8565..b914b32a 100644
--- a/www/js/NewsCtrl.js
+++ b/www/js/NewsCtrl.js
@@ -2,7 +2,7 @@
/* jslint browser: true*/
/* global cordova,StatusBar,angular,console,moment*/
-angular.module('zmApp.controllers').controller('zmApp.NewsCtrl', ['$scope', '$rootScope', '$ionicModal', 'ZMDataModel','$ionicSideMenuDelegate', '$ionicHistory', '$state', '$http', 'zm', '$localstorage', function ($scope, $rootScope, $ionicModal, ZMDataModel,$ionicSideMenuDelegate, $ionicHistory, $state, $http, zm, $localstorage) {
+angular.module('zmApp.controllers').controller('zmApp.NewsCtrl', ['$scope', '$rootScope', '$ionicModal', 'ZMDataModel','$ionicSideMenuDelegate', '$ionicHistory', '$state', '$http', 'zm', function ($scope, $rootScope, $ionicModal, ZMDataModel,$ionicSideMenuDelegate, $ionicHistory, $state, $http, zm) {
$scope.openMenu = function () {
$ionicSideMenuDelegate.toggleLeft();
};
@@ -39,7 +39,8 @@ $scope.openMenu = function () {
$scope.isUnread = function(itemdate)
{
- var lastDate = $localstorage.get("latestBlogPostChecked");
+ var lastDate = ZMDataModel.getLatestBlogPostChecked();
+ //get("latestBlogPostChecked");
if (!lastDate) return true;
var mLastDate = moment(lastDate);
var mItemDate = moment(itemdate);
@@ -52,13 +53,15 @@ $scope.openMenu = function () {
$scope.loadPost = function (item, itemdate)
{
- var lastDate = $localstorage.get("latestBlogPostChecked");
+ var lastDate =
+ ZMDataModel.getLatestBlogPostChecked(); //zmStorageService.get("latestBlogPostChecked");
if (!lastDate)
{
ZMDataModel.zmDebug ("First time checking blog posts, I see");
- $localstorage.set("latestBlogPostChecked", itemdate);
+ ZMDataModel.setLatestBlogPostChecked(itemdate);
+ //zmStorageService.set("latestBlogPostChecked", itemdate);
}
else
@@ -71,7 +74,8 @@ $scope.openMenu = function () {
if (mItemDate.diff(mLastDate) >0)
{
ZMDataModel.zmDebug ("Updating lastDate to this post");
- $localstorage.set("latestBlogPostChecked", itemdate);
+
+ ZMDataModel.setLatestBlogPostChecked(itemdate); //zmStorageService.set("latestBlogPostChecked", itemdate);
if (itemdate == $scope.newsItems[0].date)
{