guard against next page not being found in AP feed
This commit is contained in:
parent
f4b6ab38f3
commit
06ece16d62
|
@ -204,6 +204,7 @@ async function itemsForFeed(opts,user,feed) {
|
||||||
|
|
||||||
function getNextPage(opts,user,feed){
|
function getNextPage(opts,user,feed){
|
||||||
//based on feed.next
|
//based on feed.next
|
||||||
|
if (!feed.next){return null}
|
||||||
// take feed.next, uriencode it, then take user url, then take options.mastofeedUrl
|
// take feed.next, uriencode it, then take user url, then take options.mastofeedUrl
|
||||||
var base = opts.mastofeedUrl.slice(0,opts.mastofeedUrl.indexOf('?'));
|
var base = opts.mastofeedUrl.slice(0,opts.mastofeedUrl.indexOf('?'));
|
||||||
|
|
||||||
|
|
|
@ -92,15 +92,12 @@
|
||||||
<a class="date" href="<%= item.permalink %>"><%= item.stringDate %></a>
|
<a class="date" href="<%= item.permalink %>"><%= item.stringDate %></a>
|
||||||
</div>
|
</div>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
<% if (nextPageLink) %>
|
|
||||||
<div class="item hidden">
|
|
||||||
<a class="hacky_link" href="<%- nextPageLink %>">More</a>
|
|
||||||
</div>
|
|
||||||
<% %>
|
|
||||||
</div> <!-- end item container -->
|
</div> <!-- end item container -->
|
||||||
<div class="pagination">
|
<% if (nextPageLink){ %>
|
||||||
<a class="button" href="<%- nextPageLink %>">Load More</a>
|
<div class="pagination">
|
||||||
</div>
|
<a class="button hacky_link" href="<%- nextPageLink %>">Load More</a>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
<% if ( isIndex ){ %>
|
<% if ( isIndex ){ %>
|
||||||
<script src="/infinite-scroll.js"></script>
|
<script src="/infinite-scroll.js"></script>
|
||||||
|
|
Loading…
Reference in New Issue