From 98d217f4ea369619e4df17a3853c5a12cf7f61da Mon Sep 17 00:00:00 2001 From: Michael Gregorio Date: Mon, 16 Oct 2017 17:10:26 +0800 Subject: [PATCH] fix double loading in grid list --- client/app/dashboard/model/list/ModelList.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/app/dashboard/model/list/ModelList.js b/client/app/dashboard/model/list/ModelList.js index aab21067..ef6eb756 100644 --- a/client/app/dashboard/model/list/ModelList.js +++ b/client/app/dashboard/model/list/ModelList.js @@ -730,7 +730,10 @@ angular.module('dashboard.Dashboard.Model.List', [ $scope.$watch('sortInfo', function (newVal, oldVal) { //Check isFirstLoad so that this watch statement does not get called when the page loads for the first time - if (!isFirstLoad && newVal !== oldVal) { + if (!isFirstLoad && + newVal && oldVal && + (!_.isEqual(newVal.directions, oldVal.directions) || + !_.isEqual(newVal.fields, oldVal.fields))) { $scope.loadItems(); } }, true);