guard against next page not being found in AP feed

This commit is contained in:
Drew Harwell 2019-11-22 10:46:46 -05:00
parent f4b6ab38f3
commit 06ece16d62
2 changed files with 6 additions and 8 deletions

View File

@ -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('?'));

View File

@ -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>