File tree Expand file tree Collapse file tree 5 files changed +30
-3
lines changed Expand file tree Collapse file tree 5 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,14 @@ - (void)viewWillAppear:(BOOL)animated
6464 [super viewWillAppear: animated];
6565 [AppDelegate theDelegate ].masterTabBarController .tabBar .tintColor = ThemeService.shared .theme .tintColor ;
6666
67- if (recentsDataSource)
67+ if (recentsDataSource. recentsDataSourceMode != RecentsDataSourceModeFavourites )
6868 {
6969 // Take the lead on the shared data source.
7070 [recentsDataSource setDelegate: self andRecentsDataSourceMode: RecentsDataSourceModeFavourites];
71+
72+ // Reset filtering on the shared data source when switching tabs
73+ [recentsDataSource searchWithPatterns: nil ];
74+ [self .recentsSearchBar setText: nil ];
7175 }
7276}
7377
Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ - (void)viewWillAppear:(BOOL)animated
112112 {
113113 // Take the lead on the shared data source.
114114 [recentsDataSource setDelegate: self andRecentsDataSourceMode: RecentsDataSourceModeHome];
115+
116+ // Reset filtering on the shared data source when switching tabs
117+ [self searchBarCancelButtonClicked: self .recentsSearchBar];
118+ [self .recentsSearchBar setText: nil ];
115119 }
116120}
117121
Original file line number Diff line number Diff line change @@ -90,7 +90,16 @@ - (void)viewWillAppear:(BOOL)animated
9090 {
9191 // Take the lead on the shared data source.
9292 recentsDataSource = (RecentsDataSource*)self.dataSource ;
93- [recentsDataSource setDelegate: self andRecentsDataSourceMode: RecentsDataSourceModePeople];
93+
94+ if (recentsDataSource.recentsDataSourceMode != RecentsDataSourceModePeople)
95+ {
96+ // Take the lead on the shared data source.
97+ [recentsDataSource setDelegate: self andRecentsDataSourceMode: RecentsDataSourceModePeople];
98+
99+ // Reset filtering on the shared data source when switching tabs
100+ [recentsDataSource searchWithPatterns: nil ];
101+ [self .recentsSearchBar setText: nil ];
102+ }
94103 }
95104}
96105
Original file line number Diff line number Diff line change @@ -72,7 +72,16 @@ - (void)viewWillAppear:(BOOL)animated
7272 {
7373 // Take the lead on the shared data source.
7474 recentsDataSource = (RecentsDataSource*)self.dataSource ;
75- [recentsDataSource setDelegate: self andRecentsDataSourceMode: RecentsDataSourceModeRooms];
75+
76+ if (recentsDataSource.recentsDataSourceMode != RecentsDataSourceModeRooms)
77+ {
78+ // Take the lead on the shared data source.
79+ [recentsDataSource setDelegate: self andRecentsDataSourceMode: RecentsDataSourceModeRooms];
80+
81+ // Reset filtering on the shared data source when switching tabs
82+ [recentsDataSource searchWithPatterns: nil ];
83+ [self .recentsSearchBar setText: nil ];
84+ }
7685 }
7786}
7887
Original file line number Diff line number Diff line change 1+ Reset home filters when switching tabs.
You can’t perform that action at this time.
0 commit comments