Skip to content

Commit

Permalink
fix(appellate): Adds logic to check for 'selectedDocuments' key
Browse files Browse the repository at this point in the history
  • Loading branch information
ERosendo committed Jul 18, 2024
1 parent a63d41b commit 33be43e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/appellate/appellate.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,15 @@ AppellateDelegate.prototype.handleAcmsDownloadPage = async function () {
.toLowerCase()
.includes('accept charges and retrieve');

let hasOneDocument = JSON.parse(
sessionStorage.selectedDocuments
).length == 1;
// The `selectedDocuments` key in sessionStorage is only available when
// the download page is loaded from an attachment page. It is not
// available when loaded from a case summary entry. This check ensures
// the extension can handle both scenarios gracefully.
let hasOneDocument = true;
if (sessionStorage.getItem('selectedDocuments')) {
hasOneDocument =
JSON.parse(sessionStorage.selectedDocuments).length == 1;
}

if (
n.localName === 'div' &&
Expand Down

0 comments on commit 33be43e

Please sign in to comment.