Commit 21b172dc by vss宋顺

fix record visit app bug

parent 586006a9
...@@ -83,7 +83,15 @@ function ConfigBaseInfoController($rootScope, $scope, $location, toastr, UserSer ...@@ -83,7 +83,15 @@ function ConfigBaseInfoController($rootScope, $scope, $location, toastr, UserSer
var VISITED_APPS_STORAGE_KEY = "VisitedAppsV2"; var VISITED_APPS_STORAGE_KEY = "VisitedAppsV2";
var visitedAppsObject = JSON.parse(localStorage.getItem(VISITED_APPS_STORAGE_KEY)); var visitedAppsObject = JSON.parse(localStorage.getItem(VISITED_APPS_STORAGE_KEY));
var hasSaved = false; var hasSaved = false;
if (visitedAppsObject) {
if (!visitedAppsObject) {
visitedAppsObject = {};
}
if (!visitedAppsObject[$rootScope.pageContext.userId]) {
visitedAppsObject[$rootScope.pageContext.userId] = [];
}
var visitedApps = visitedAppsObject[$rootScope.pageContext.userId]; var visitedApps = visitedAppsObject[$rootScope.pageContext.userId];
if (visitedApps && visitedApps.length > 0) { if (visitedApps && visitedApps.length > 0) {
visitedApps.forEach(function (app) { visitedApps.forEach(function (app) {
...@@ -94,11 +102,6 @@ function ConfigBaseInfoController($rootScope, $scope, $location, toastr, UserSer ...@@ -94,11 +102,6 @@ function ConfigBaseInfoController($rootScope, $scope, $location, toastr, UserSer
}); });
} }
} else {
visitedAppsObject = {};
visitedAppsObject[$rootScope.pageContext.userId] = [];
}
var currentUserVisitedApps = visitedAppsObject[$rootScope.pageContext.userId]; var currentUserVisitedApps = visitedAppsObject[$rootScope.pageContext.userId];
if (!hasSaved) { if (!hasSaved) {
//if queue's length bigger than 6 will remove oldest app //if queue's length bigger than 6 will remove oldest app
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment