Skip to content

Commit

Permalink
feat: sub rss feed
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed May 12, 2024
1 parent 295e49e commit 8dfe7c8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
16 changes: 16 additions & 0 deletions web/feed-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion web/sub-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<div class="flex mb-4" id="area-id">
<label for="id" style="margin-top: 0.125rem">Id</label>
<input type="text" readonly="readonly" id="id" class="ml-2">
<a style="display: none" id="sub-feed-link" target="_blank">
<a id="sub-feed-link" target="_blank">
<img class="ml-2" src="feed-icon.svg" width="20" height="20" alt="Subscription feed link"/>
</a>
</div>
Expand Down
14 changes: 3 additions & 11 deletions web/sub-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,9 @@ function loadSubDetailsById(id) {
document.getElementById("id").value = id;
document.getElementById("area-id").style.display = "flex";
document.getElementById("button-delete").style.display = "flex";
let subFeedLinkElement = document.getElementById("sub-feed-link");
subFeedLinkElement.href = `https://reader.awakari.com/v1/feeds/sub/${id}`;
const headers = getAuthHeaders();
const authProvider = localStorage.getItem(keyAuthProvider);
switch (authProvider) {
case "Telegram":
break;
default:
let subFeedLinkElement = document.getElementById("sub-feed-link");
subFeedLinkElement.href = `https://awakari.com/v1/sub/feed/${id}`;
subFeedLinkElement.style.display = "block";
break;
}
Subscriptions
.fetch(id, headers)
.then(resp => resp ? resp.json() : null)
Expand Down Expand Up @@ -441,7 +433,7 @@ function createSubscription() {
} else {
document.getElementById("sub-new-success-btn-feed").style.display = "block";
document.getElementById("sub-new-success-btn-feed").onclick = () => {
window.open(`https://awakari.com/v1/sub/feed/${id}`, '_blank');
window.open(`https://reader.awakari.com/v1/feeds/sub/${id}`, '_blank');
}
}
}
Expand Down

0 comments on commit 8dfe7c8

Please sign in to comment.