From 22f2aaf9f03a163659fa342ded7d0f40475aaaf4 Mon Sep 17 00:00:00 2001 From: Eduardo Rosendo Date: Thu, 19 Sep 2024 10:43:18 -0400 Subject: [PATCH] feat(district): Tweak attachment page logic to get PACER case ID from DSL - Adds logic to the handleAttachmentMenuPage method to extract the pacer_case_id from the GoDLS function in cases where it's not directly available in the page's DOM. - Improves the reliability of PACER case ID retrieval on attachment pages. --- CHANGES.md | 1 + src/content_delegate.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 0f7e246d..1a1e9c4c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ Changes: Fixes: - Corrected typo in build script, ensuring correct favicon path for Firefox releases([379](https://github.com/freelawproject/recap/issues/379), [397](https://github.com/freelawproject/recap-chrome/pull/397)) + - Improves the reliability of PACER case ID retrieval on attachment pages ([369](https://github.com/freelawproject/recap/issues/369)) For developers: - Nothing yet diff --git a/src/content_delegate.js b/src/content_delegate.js index 39b949f2..3e1ad456 100644 --- a/src/content_delegate.js +++ b/src/content_delegate.js @@ -367,6 +367,15 @@ ContentDelegate.prototype.handleAttachmentMenuPage = async function () { return; } + if (!this.pacer_case_id) + this.pacer_case_id = await getPacerCaseIdFromPacerDocId( + this.tabId, + this.pacer_doc_id + ); + + // If we don't have this.pacer_case_id at this point, punt. + if (!this.pacer_case_id) return; + const upload = await dispatchBackgroundFetch({ action: 'upload', data: {