Skip to content

Commit

Permalink
Feat: Hide explore grid
Browse files Browse the repository at this point in the history
Re-add accidentally removed settings option
  • Loading branch information
SoCuul committed Mar 4, 2024
1 parent aa406d6 commit 87b90e6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 31 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:@"Hide trending searches" detailTitle:@"Hides the trending searches under the explore search bar" key:@"hide_trending_searches" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"Do not save recent searches" detailTitle:@"Search bars will no longer save your recent searches" key:@"no_recent_searches" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"Hide explore posts grid" detailTitle:@"Hides the grid of suggested posts on the explore/search tab" key:@"hide_explore_grid" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"Hide trending searches" detailTitle:@"Hides the trending searches under the explore search bar" key:@"hide_trending_searches" defaultValue:true changeAction:nil],

// Section 2: Feed
[self newSectionWithTitle:@"Feed" footer:nil],
Expand Down
29 changes: 0 additions & 29 deletions src/Features/Feed/HideExplorePosts.x

This file was deleted.

12 changes: 12 additions & 0 deletions src/Features/General/HideExploreGrid.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#import "../../InstagramHeaders.h"
#import "../../Manager.h"

%hook IGExploreGridViewController
- (id)view {
if ([BHIManager hideExploreGrid]) {
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)hideExploreGrid;
+ (BOOL)hideTrendingSearches;
+ (BOOL)Padlock;
+ (BOOL)keepDeletedMessage;
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)hideExploreGrid {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_explore_grid"];
}
+ (BOOL)hideTrendingSearches {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_trending_searches"];
}
Expand Down

0 comments on commit 87b90e6

Please sign in to comment.