Skip to content

Commit

Permalink
Feat: Hide trending searches
Browse files Browse the repository at this point in the history
  • Loading branch information
SoCuul committed Mar 2, 2024
1 parent 9e8086a commit aa406d6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Controllers/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ - (NSArray *)specifiers {
[self newSectionWithTitle:@"General" footer:nil],
[self newSwitchCellWithTitle:@"Show like count" detailTitle:@"Show like count in the post" key:@"show_like_count" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Copy description" detailTitle:@"Copy the post description with a long press" key:@"copy_description" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Do not save recent searches" detailTitle:@"Search bars will no longer save your recent searches." key:@"no_recent_searches" defaultValue:true changeAction:nil],

[self newSwitchCellWithTitle:@"Do not save recent searches" detailTitle:@"Search bars will no longer save your recent searches" key:@"no_recent_searches" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Hide trending searches" detailTitle:@"Hides the trending searches under the explore search bar" key:@"hide_trending_searches" defaultValue:false changeAction:nil],

// Section 2: Feed
[self newSectionWithTitle:@"Feed" footer:nil],
[self newSwitchCellWithTitle:@"Hide Ads" detailTitle:@"Remove all ads from the Instagram app" key:@"hide_ads" defaultValue:true changeAction:nil],
Expand Down
12 changes: 12 additions & 0 deletions src/Features/General/HideTrendingSearches.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#import "../../InstagramHeaders.h"
#import "../../Manager.h"

%hook IGDSSegmentedPillControl
+ (id)newWithStyle:(id)arg1 {
if ([BHIManager hideTrendingSearches]) {
return nil;
}

return %orig;
}
%end
1 change: 1 addition & 0 deletions src/Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
+ (BOOL)postCommentConfirmation;
+ (BOOL)copyDecription;
+ (BOOL)noRecentSearches;
+ (BOOL)hideTrendingSearches;
+ (BOOL)Padlock;
+ (BOOL)keepDeletedMessage;
+ (BOOL)hideLastSeen;
Expand Down
3 changes: 3 additions & 0 deletions src/Manager.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ + (BOOL)copyDecription {
+ (BOOL)noRecentSearches {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"no_recent_searches"];
}
+ (BOOL)hideTrendingSearches {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_trending_searches"];
}
+ (BOOL)Padlock {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"padlock"];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Tweak.x
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ BOOL dmVisualMsgsViewedButtonEnabled = false;
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"remove_screenshot_alert"];
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"show_like_count"];
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"copy_description"];
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"keep_deleted_message"];
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"call_confirm"];
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"hide_trending_searches"];

// Display settings modal on screen
UIViewController *rootController = [[self window] rootViewController];
Expand Down

0 comments on commit aa406d6

Please sign in to comment.