Skip to content

Commit

Permalink
Small fix 1.4.0 => 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Jul 18, 2023
1 parent 1dea11f commit 629a8aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "1.4.0",
"version": "1.4.1",
"manifest_version": 2,
"browser_specific_settings": {
"gecko": {
Expand Down
12 changes: 10 additions & 2 deletions src/pages/lib/lemmy.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ function get_post(url) {
const req = new XMLHttpRequest();
req.open("GET", `${url.protocol}//${url.hostname}/api/v3/post?id=${postRegex[1]}`, false);
req.onload = async () => {
resolve(JSON.parse(req.responseText)['post_view']['post']['id'])
if (req.status == 200) {
resolve(JSON.parse(req.responseText)['post_view']['post']['ap_id'])
return
}
resolve()
}
req.send()
} else {
Expand Down Expand Up @@ -96,7 +100,11 @@ function get_comment(url) {
const req = new XMLHttpRequest();
req.open("GET", `${url.protocol}//${url.hostname}/api/v3/comment?id=${commentRegex[1]}`, false);
req.onload = async () => {
resolve(JSON.parse(req.responseText)['comment_view']['comment']['id'])
if (req.status == 200) {
resolve(JSON.parse(req.responseText)['comment_view']['comment']['ap_id'])
return
}
resolve()
}
req.send()
} else {
Expand Down

0 comments on commit 629a8aa

Please sign in to comment.