Skip to content

Commit

Permalink
fix saved replies fetch returns html
Browse files Browse the repository at this point in the history
  • Loading branch information
awright18 committed May 4, 2024
1 parent da034f6 commit 250f0f4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
9 changes: 3 additions & 6 deletions src/ChromeExtension/js/modules/fetch-saved-replies.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/ChromeExtension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
9 changes: 3 additions & 6 deletions src/FirefoxExtension/js/modules/fetch-saved-replies.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/FirefoxExtension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 250f0f4

Please sign in to comment.