Do not show user indicators when the view controller is not visible

This commit is contained in:
Andy Uhnak
2022-03-10 15:33:50 +00:00
parent 6b068a6753
commit 863d7ca2bd
4 changed files with 24 additions and 4 deletions
+12 -2
View File
@@ -567,7 +567,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
isAppeared = NO;
[VoiceMessageMediaServiceProvider.sharedProvider pauseAllServices];
[self stopActivityIndicator];
// Stop the loading indicator even if the session is still in progress
[self stopLoadingIndicator];
}
- (void)viewDidAppear:(BOOL)animated
@@ -956,14 +958,22 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
notificationTaskProfile = nil;
}
if ([self providesCustomActivityIndicator]) {
// The legacy super implementation of `stopActivityIndicator` contains a number of checks grouped under `canStopActivityIndicator`
// to determine whether the indicator can be stopped or not (and the method should thus rather be called `stopActivityIndicatorIfPossible`).
// Since the newer indicators are not calling super implementation, the check for `canStopActivityIndicator` has to be performed manually.
if ([self canStopActivityIndicator]) {
[self.delegate roomViewControllerDidStopLoading:self];
[self stopLoadingIndicator];
}
} else {
[super stopActivityIndicator];
}
}
- (void)stopLoadingIndicator
{
[self.delegate roomViewControllerDidStopLoading:self];
}
- (void)displayRoom:(MXKRoomDataSource *)dataSource
{
// Remove potential preview Data