Skip to content

Commit

Permalink
fix: hide trending searches crashing with meta ai search
Browse files Browse the repository at this point in the history
  • Loading branch information
SoCuul committed May 12, 2024
1 parent fed0f7d commit 4604b7a
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions src/Features/General/HideTrendingSearches.x
Original file line number Diff line number Diff line change
@@ -1,36 +1,16 @@
#import "../../InstagramHeaders.h"
#import "../../Manager.h"

%hook IGKeywordSearchModel
- (id)initWithPk:(id)arg1 name:(id)arg2 score:(id)arg3 subtitle:(id)arg4 isPopular:(BOOL)arg5 isMetaAISuggestion:(BOOL)arg6 {
if ([SCIManager hideTrendingSearches]) {
NSLog(@"[SCInsta] Hiding trending searches");
%hook IGDSSegmentedPillBarView
- (void)didMoveToWindow {
%orig;

return nil;
}

return %orig;
}
- (id)initWithDictionary:(id)arg1 {
if ([SCIManager hideTrendingSearches]) {
NSLog(@"[SCInsta] Hiding trending searches");

return nil;
}

return %orig;
}
%end

// Maybe try something like this to hide reccomended search text?
/* %hook IGAnimatablePlaceholderModel
- (id)initWithId:(id)arg1 placeholderText:(id)arg2 placeholderName:(id)arg3 placeholderType:(id)arg4 {
if ([SCIManager hideTrendingSearches]) {
NSLog(@"[SCInsta] Hiding trending searches");
if ([[self delegate] isKindOfClass:%c(IGSearchTypeaheadNavigationHeaderView)]) {
if ([SCIManager hideTrendingSearches]) {
NSLog(@"[SCInsta] Hiding trending searches");

return nil;
[self removeFromSuperview];
}
}
return %orig;
}
%end */
%end

0 comments on commit 4604b7a

Please sign in to comment.