switched circle post loader to use fetch instead of xml http
parent
83a1c09af7
commit
427a5355bc
|
@ -147,19 +147,26 @@ function getBlocks(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var feedText = httpGet('/flow/getpostsbyboard/' + ch) // TODO switch to fetch
|
fetch('/flow/getpostsbyboard/' + ch, {
|
||||||
var blockList = feedText.split(',')
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
"token": webpass
|
||||||
|
}})
|
||||||
|
.then((resp) => resp.text())
|
||||||
|
.then(function(feedText) {
|
||||||
|
var blockList = feedText.split(',')
|
||||||
|
|
||||||
for (i = 0; i < blockList.length; i++){
|
for (i = 0; i < blockList.length; i++){
|
||||||
blockList[i] = "0".repeat(64 - blockList[i].length) + blockList[i] // pad hash with zeroes
|
blockList[i] = "0".repeat(64 - blockList[i].length) + blockList[i] // pad hash with zeroes
|
||||||
|
|
||||||
if (! requested.includes(blockList[i])){
|
if (! requested.includes(blockList[i])){
|
||||||
if (blockList[i].length == 0) continue
|
if (blockList[i].length == 0) continue
|
||||||
else requested.push(blockList[i])
|
else requested.push(blockList[i])
|
||||||
loadMessage(blockList[i], blockList, i, ch);
|
loadMessage(blockList[i], blockList, i, ch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
sortEntries()
|
||||||
sortEntries()
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadMessage(blockHash, blockList, count, channel){
|
function loadMessage(blockHash, blockList, count, channel){
|
||||||
|
|
Loading…
Reference in New Issue