Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function deleteDuplicates(){
var shouts = $('#Feed-list > .activity-element > .clearfix.shout-footer > .s-action-list').map((i,e)=>{
return ( $(e).attr('data-id') )
}).toArray();
var duplicated = shouts.filter( (elem, index, arr) => arr.indexOf(elem) !== index );
duplicated.forEach((shout)=>{
$("#Feed-list > .activity-element > .clearfix.shout-footer > div[data-id="+shout+"]").each((i,e)=>{
if(i===0)
return;
$(e).parent().parent()[0].remove()
});
})
}
deleteDuplicates();
$(document).ajaxSuccess(function(event, jqXHR, settings) {
if (settings.url.indexOf('ajax/feed/fetch') > -1 || settings.url.indexOf('serv/more/trend') > -1)
deleteDuplicates();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.