Skip to content

Commit

Permalink
update with pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Solorio committed Nov 21, 2021
1 parent 39be1b1 commit 82d7c49
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/assets/v2/js/grants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ if (document.getElementById('grants-showcase')) {
editingCollection: false,
createCollectionRedirect: false,
activeTimeout: null,
scrollTriggered: false
scrollTriggered: false,
previouslyLoadedGrants: {},
},
methods: {
toggleStyle: function(style) {
Expand Down Expand Up @@ -319,13 +320,13 @@ if (document.getElementById('grants-showcase')) {

if (!append_mode) {
vm.grants = [];
vm.prevouslyLoadedGrants = {};
}

const previouslyLoadedIds = vm.grants.map(grant => grant.id);

getGrants.grants.forEach(function(item) {
if (!previouslyLoadedIds.includes(item.id)) {
if (!vm.prevouslyLoadedGrants[item.id]) {
vm.grants.push(item);
vm.previouslyLoadedGrants[item.id] = item;
}
});

Expand Down

0 comments on commit 82d7c49

Please sign in to comment.