1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 15:25:59 +00:00

fail better if requested article URL is blank

This commit is contained in:
Andrew Dolgov
2021-02-13 10:10:44 +03:00
parent d3940b6259
commit eec5871f5f
4 changed files with 27 additions and 24 deletions

View File

@@ -123,11 +123,13 @@ const Article = {
Article.setActive(0);
},
displayUrl: function (id) {
const query = {op: "rpc", method: "getlinktitlebyid", id: id};
const query = {op: "article", method: "get_metadata_by_id", id: id};
xhrJson("backend.php", query, (reply) => {
if (reply && reply.link) {
prompt(__("Article URL:"), reply.link);
} else {
alert(__("No URL could be displayed for this article."));
}
});
},

View File

@@ -332,7 +332,7 @@ const Filters = {
} else {
const query = {op: "rpc", method: "getlinktitlebyid", id: Article.getActive()};
const query = {op: "article", method: "get_metadata_by_id", id: Article.getActive()};
xhrPost("backend.php", query, (transport) => {
const reply = JSON.parse(transport.responseText);