Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
fixed #27 duplicate messages scrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
pishangujeniya committed Apr 7, 2021
1 parent efab5f9 commit e7bc508
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion InstagramHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,19 @@ class InstagramHelper {

//#region Adding Messages
data.thread.items.forEach(element => {
this.allMessagesItemsArray.push(element);

var isExists = false;

for (let index = 0; index < this.allMessagesItemsArray.length; index++) {
const existingElement = this.allMessagesItemsArray[index];
if (existingElement.item_id.toString() == element.item_id.toString()) {
isExists = true;
break;
}
}
if (!isExists) {
this.allMessagesItemsArray.push(element);
}
});
//#endregion
data.thread.items.forEach(element => {
Expand Down

0 comments on commit e7bc508

Please sign in to comment.