Skip to content

Commit

Permalink
fix: make empty listings actually empty
Browse files Browse the repository at this point in the history
Some empty listings were misbehaving and claiming that they had a single
entry that was `undefined`. This was a lie, and they have been told off.
  • Loading branch information
thislooksfun committed May 14, 2021
1 parent 3045af7 commit f8467ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/listings/listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ export default class Listing<T> {
if (page.next) {
return page.next;
} else if (page.fetcher) {
return await page.fetcher.fetch(ctx);
const next = await page.fetcher.fetch(ctx);
return next.arr.length > 0 ? next : null;
} else {
return null;
}
Expand Down

0 comments on commit f8467ca

Please sign in to comment.