Skip to content

Commit 4c2754f

Browse files
committed
feat: remove loading spinner at end of feed
1 parent 25d05c9 commit 4c2754f

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/Features/Feed/HideFeedItems.xm

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,20 @@ static NSArray *removeItemsInList(NSArray *list, BOOL isFeed) {
116116
// Suggested posts/reels
117117
%hook IGMainFeedListAdapterDataSource
118118
- (NSArray *)objectsForListAdapter:(id)arg1 {
119-
return removeItemsInList(%orig, YES);
119+
NSArray *filteredObjs = removeItemsInList(%orig, YES);
120+
121+
// Remove loading spinner at end of feed (if 5 or less items in feed)
122+
NSUInteger arrayLength = [filteredObjs count];
123+
124+
if (arrayLength <= 5) {
125+
filteredObjs = [filteredObjs filteredArrayUsingPredicate:
126+
[NSPredicate predicateWithBlock:^BOOL(id obj, NSDictionary *bindings) {
127+
return ![obj isKindOfClass:[%c(IGSpinnerLabelViewModel) class]];
128+
}]
129+
];
130+
}
131+
132+
return filteredObjs;
120133
}
121134
%end
122135
%hook IGSundialFeedDataSource

0 commit comments

Comments
 (0)