Skip to content

Commit

Permalink
Add namespace to localStorage entities for diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Holtslander committed Mar 7, 2016
1 parent c2b6db4 commit e300819
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pullrequest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var isGitHub = $("meta[property='og:site_name']").attr('content') === 'GitHub';
var useLocalStorage = true;
var lsNamespace = 'ppr'; // Prepend to entries in localStorage for some namespacing to make deletion easier.
var pullRequestNumber;
var commitHash;
var repositoryName;
Expand Down Expand Up @@ -58,10 +59,10 @@ function getId(path) {
return id;
}

function uniquify(id) {
function uniquify(diffId) {
var diffViewId = pullRequestNumber || commitHash;

return repositoryAuthor + '|' + repositoryName + '|' + diffViewId + '|' + id;
return lsNamespace + '|' + repositoryAuthor + '|' + repositoryName + '|' + diffViewId + '|' + diffId;
}

function collectUniquePageInfo() {
Expand Down

0 comments on commit e300819

Please sign in to comment.