adding some debugging to the new reply retrieval
All checks were successful
/ weblog.lol (push) Successful in 8s
All checks were successful
/ weblog.lol (push) Successful in 8s
This commit is contained in:
parent
4b0bec8779
commit
292c54fe5e
1 changed files with 5 additions and 0 deletions
|
@ -120,6 +120,7 @@ class FediSocial extends HTMLElement {
|
||||||
customElements.define('fedi-social', FediSocial)
|
customElements.define('fedi-social', FediSocial)
|
||||||
|
|
||||||
function renderReplies(status, replies, replyContainer, template) {
|
function renderReplies(status, replies, replyContainer, template) {
|
||||||
|
console.log(status)
|
||||||
const repliesToThis = replies.filter(d => d.in_reply_to_id == status.id);
|
const repliesToThis = replies.filter(d => d.in_reply_to_id == status.id);
|
||||||
|
|
||||||
repliesToThis.forEach(reply => {
|
repliesToThis.forEach(reply => {
|
||||||
|
@ -151,14 +152,18 @@ function renderReplies(status, replies, replyContainer, template) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadContext(status, replyContainer, template) {
|
async function loadContext(status, replyContainer, template) {
|
||||||
|
console.log('Loading context');
|
||||||
try{
|
try{
|
||||||
const res = await fetch(`https://monrepos.casa/api/v1/statuses/${status.id}/context`, {
|
const res = await fetch(`https://monrepos.casa/api/v1/statuses/${status.id}/context`, {
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Basic Ym90OjJuUmZhTGJ1c3cyaFhA'
|
'Authorization': 'Basic Ym90OjJuUmZhTGJ1c3cyaFhA'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log(res)
|
||||||
const json = await res.json()
|
const json = await res.json()
|
||||||
|
|
||||||
|
console.log(json)
|
||||||
|
|
||||||
if(json && json.descendants && json.descendants.length > 0){
|
if(json && json.descendants && json.descendants.length > 0){
|
||||||
const h1 = document.createElement('h1')
|
const h1 = document.createElement('h1')
|
||||||
h1.innerText = "Replies"
|
h1.innerText = "Replies"
|
||||||
|
|
Loading…
Reference in a new issue