Skip to content

Commit

Permalink
fix: make stubbed listings actually work
Browse files Browse the repository at this point in the history
Due to a logic error in v1.0.0-dev.15, the Listings returned by the
following methods would act as if they were empty.

- `PostControls::search()`
- `SubredditControls::getControversialPosts()`
- `SubredditControls::getEdited()`
- `SubredditControls::getEditedComments()`
- `SubredditControls::getEditedPosts()`
- `SubredditControls::getHotPosts()`
- `SubredditControls::getModqueue()`
- `SubredditControls::getModqueueComments()`
- `SubredditControls::getModqueuePosts()`
- `SubredditControls::getNewPosts()`
- `SubredditControls::getReported()`
- `SubredditControls::getReportedComments()`
- `SubredditControls::getReportedPosts()`
- `SubredditControls::getRisingPosts()`
- `SubredditControls::getSortedComments()`
- `SubredditControls::getSpam()`
- `SubredditControls::getSpamComments()`
- `SubredditControls::getSpamPosts()`
- `SubredditControls::getTopPosts()`
- `SubredditControls::getUnmoderated()`
- `SubredditControls::getUnmoderatedComments()`
- `SubredditControls::getUnmoderatedPosts()`
- `UserControls::getPosts()`
- `UserControls::getSortedComments()`
- And also some comment reply chains
  • Loading branch information
thislooksfun committed Mar 27, 2022
1 parent aedc8bc commit a89c115
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/reddit/comment/listing/listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class CommentListing extends Listing<Comment> {
constructor(l: RedditListing, context: ListingContext) {
let fetcher: Fetcher<Comment> | undefined;

if (l.after) {
if (l.after != undefined) {
fetcher = new CommentPager(l.after);
}

Expand Down
2 changes: 1 addition & 1 deletion src/reddit/post-or-comment/listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class PostOrCommentListing extends Listing<Post | Comment> {
constructor(l: RedditListing, context: ListingContext) {
let fetcher: Fetcher<Post | Comment> | undefined;

if (l.after) {
if (l.after != undefined) {
fetcher = new PostOrCommentPager(l.after);
}

Expand Down
2 changes: 1 addition & 1 deletion src/reddit/post/listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class PostListing extends Listing<Post> {
constructor(l: RedditListing, context: ListingContext) {
let fetcher: Fetcher<Post> | undefined;

if (l.after) {
if (l.after != undefined) {
fetcher = new PostPager(l.after);
}

Expand Down

0 comments on commit a89c115

Please sign in to comment.