diff --git a/plugins/ap-list.user.js b/plugins/ap-list.user.js index 02fa580b..77b183af 100644 --- a/plugins/ap-list.user.js +++ b/plugins/ap-list.user.js @@ -268,7 +268,9 @@ window.plugin.apList.updateSortedPortals = function() { var cachedPortal = oldcachedPortal[key]; // If portal is changed, update playerApGain with latest // information - if(!cachedPortal || value.timestamp !== cachedPortal.timestamp) { + if(!cachedPortal + || value.timestamp !== cachedPortal.timestamp + || plugin.apList.isFieldsChanged(portal.portalV2.linkedFields, cachedPortal.portalV2.linkedFields)) { // Shallow copy portal detail to cachedPortal cachedPortal = $.extend({}, portal); var side = plugin.apList.portalSide(portal); @@ -374,6 +376,11 @@ window.plugin.apList.updateTotalPages = function() { }); } +window.plugin.apList.isFieldsChanged = function(a,b) { + // http://stackoverflow.com/questions/1773069/using-jquery-to-compare-two-arrays + return $(a).not(b).get().length === 0 && $(b).not(a).get().length === 0;; +} + window.plugin.apList.portalSide = function(portal) { return (portal.controllingTeam.team === PLAYER.team || portal.controllingTeam.team === 'NEUTRAL')