Skip to content

Commit

Permalink
Merge pull request open-source-labs#6 from Theqwertypusher/feature
Browse files Browse the repository at this point in the history
(added) duplicate snapshot check in background.js
  • Loading branch information
Theqwertypusher authored Oct 7, 2020
2 parents 7205047 + 62ca485 commit f56663f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ chrome.runtime.onMessage.addListener((request, sender) => {
break;
}

// DUPLICATE SNAPSHOT CHECK
const previousSnap = tabsObj[tabId].currLocation.stateSnapshot.children[0].componentData.actualDuration;
const incomingSnap = request.payload.children[0].componentData.actualDuration;
if (previousSnap === incomingSnap) break;

// don't add anything to snapshot storage if tab is reloaded for the initial snapshot
if (reloaded[tabId]) {
reloaded[tabId] = false;
Expand Down

0 comments on commit f56663f

Please sign in to comment.