diff --git a/Riot/Modules/Favorites/FavouritesViewController.m b/Riot/Modules/Favorites/FavouritesViewController.m index 13a3fa7aa..096f74ba3 100644 --- a/Riot/Modules/Favorites/FavouritesViewController.m +++ b/Riot/Modules/Favorites/FavouritesViewController.m @@ -64,10 +64,14 @@ [super viewWillAppear:animated]; [AppDelegate theDelegate].masterTabBarController.tabBar.tintColor = ThemeService.shared.theme.tintColor; - if (recentsDataSource) + if (recentsDataSource.recentsDataSourceMode != RecentsDataSourceModeFavourites) { // Take the lead on the shared data source. [recentsDataSource setDelegate:self andRecentsDataSourceMode:RecentsDataSourceModeFavourites]; + + // Reset filtering on the shared data source when switching tabs + [recentsDataSource searchWithPatterns:nil]; + [self.recentsSearchBar setText:nil]; } } diff --git a/Riot/Modules/Home/HomeViewController.m b/Riot/Modules/Home/HomeViewController.m index 76b693d31..d842baa44 100644 --- a/Riot/Modules/Home/HomeViewController.m +++ b/Riot/Modules/Home/HomeViewController.m @@ -112,6 +112,10 @@ { // Take the lead on the shared data source. [recentsDataSource setDelegate:self andRecentsDataSourceMode:RecentsDataSourceModeHome]; + + // Reset filtering on the shared data source when switching tabs + [self searchBarCancelButtonClicked:self.recentsSearchBar]; + [self.recentsSearchBar setText:nil]; } } diff --git a/Riot/Modules/People/PeopleViewController.m b/Riot/Modules/People/PeopleViewController.m index 83c0a2e02..2d4e164cd 100644 --- a/Riot/Modules/People/PeopleViewController.m +++ b/Riot/Modules/People/PeopleViewController.m @@ -90,7 +90,16 @@ { // Take the lead on the shared data source. recentsDataSource = (RecentsDataSource*)self.dataSource; - [recentsDataSource setDelegate:self andRecentsDataSourceMode:RecentsDataSourceModePeople]; + + if (recentsDataSource.recentsDataSourceMode != RecentsDataSourceModePeople) + { + // Take the lead on the shared data source. + [recentsDataSource setDelegate:self andRecentsDataSourceMode:RecentsDataSourceModePeople]; + + // Reset filtering on the shared data source when switching tabs + [recentsDataSource searchWithPatterns:nil]; + [self.recentsSearchBar setText:nil]; + } } } diff --git a/Riot/Modules/Rooms/RoomsViewController.m b/Riot/Modules/Rooms/RoomsViewController.m index 700e294f3..51b203c44 100644 --- a/Riot/Modules/Rooms/RoomsViewController.m +++ b/Riot/Modules/Rooms/RoomsViewController.m @@ -72,7 +72,16 @@ { // Take the lead on the shared data source. recentsDataSource = (RecentsDataSource*)self.dataSource; - [recentsDataSource setDelegate:self andRecentsDataSourceMode:RecentsDataSourceModeRooms]; + + if (recentsDataSource.recentsDataSourceMode != RecentsDataSourceModeRooms) + { + // Take the lead on the shared data source. + [recentsDataSource setDelegate:self andRecentsDataSourceMode:RecentsDataSourceModeRooms]; + + // Reset filtering on the shared data source when switching tabs + [recentsDataSource searchWithPatterns:nil]; + [self.recentsSearchBar setText:nil]; + } } } diff --git a/changelog.d/6004.bugfix b/changelog.d/6004.bugfix new file mode 100644 index 000000000..b868a2804 --- /dev/null +++ b/changelog.d/6004.bugfix @@ -0,0 +1 @@ +Reset home filters when switching tabs. \ No newline at end of file