Skip to content

Commit

Permalink
refactor(recap extension): Refactor the logic to get the cookie value
Browse files Browse the repository at this point in the history
- Use a different approach to get the value of the isFilingAccount cookie
  • Loading branch information
ERosendo committed Nov 19, 2022
1 parent 7928014 commit e2a07cf
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/pacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,11 @@ let PACER = {
},

// Given document.cookie, returns true if the user has filing rights.
hasFilingCooking: function (cookieString){
let cookies = {};
cookieString.replace(/\s*([^=;]+)=([^;]*)/g, function (match, name, value) {
cookies[name.trim()] = value.trim();
});
let filingCookie = cookies['filing']
console.log(filingCookie)
return !!(filingCookie && filingCookie.match(/true/));
hasFilingCookie: function (cookieString){
let filingCookie = cookieString.split('; ')
.find((row) => row.startsWith('isFilingAccount'))
?.split('=')[1];
return !!filingCookie.match(/true/);
},

// Returns true if the given court identifier is for an appellate court.
Expand Down

0 comments on commit e2a07cf

Please sign in to comment.