From 250f0f4afa5fa2c7e7530cbcf1471deedef1e66f Mon Sep 17 00:00:00 2001 From: Adam Wright Date: Sat, 4 May 2024 11:48:11 -0500 Subject: [PATCH] fix saved replies fetch returns html --- src/ChromeExtension/js/modules/fetch-saved-replies.js | 9 +++------ src/ChromeExtension/manifest.json | 2 +- src/FirefoxExtension/js/modules/fetch-saved-replies.js | 9 +++------ src/FirefoxExtension/manifest.json | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/ChromeExtension/js/modules/fetch-saved-replies.js b/src/ChromeExtension/js/modules/fetch-saved-replies.js index fafb8b9..95f6d06 100644 --- a/src/ChromeExtension/js/modules/fetch-saved-replies.js +++ b/src/ChromeExtension/js/modules/fetch-saved-replies.js @@ -32,13 +32,10 @@ const tryParseReplies = async (response) => { return false; } - const json = await response.json(); - - if(response.ok && json){ - return json.payload.blob.richText; + if(response.ok){ + + return await response.text(); } - - throw new Error("Problem parsing response"); } const fetchSavedRepliesFromUrl = async (savedRepliesUrl) => { diff --git a/src/ChromeExtension/manifest.json b/src/ChromeExtension/manifest.json index 409b679..b65bdd3 100644 --- a/src/ChromeExtension/manifest.json +++ b/src/ChromeExtension/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "Shared Saved Replies", "description": "Adds saved replies to GitHub's saved replies list when commenting on issues or pull requests.", - "version": "0.0.4", + "version": "0.0.5", "action":{ "default_popup": "pages/popup/popup.html" }, diff --git a/src/FirefoxExtension/js/modules/fetch-saved-replies.js b/src/FirefoxExtension/js/modules/fetch-saved-replies.js index fafb8b9..95f6d06 100644 --- a/src/FirefoxExtension/js/modules/fetch-saved-replies.js +++ b/src/FirefoxExtension/js/modules/fetch-saved-replies.js @@ -32,13 +32,10 @@ const tryParseReplies = async (response) => { return false; } - const json = await response.json(); - - if(response.ok && json){ - return json.payload.blob.richText; + if(response.ok){ + + return await response.text(); } - - throw new Error("Problem parsing response"); } const fetchSavedRepliesFromUrl = async (savedRepliesUrl) => { diff --git a/src/FirefoxExtension/manifest.json b/src/FirefoxExtension/manifest.json index f088bba..28046a9 100644 --- a/src/FirefoxExtension/manifest.json +++ b/src/FirefoxExtension/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "Shared Saved Replies", "description": "Adds saved replies to GitHub's saved replies list when commenting on issues or pull requests.", - "version": "0.0.3", + "version": "0.0.5", "action":{ "default_popup": "pages/popup/popup.html" },