mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
New loading indicators when creating a room
This commit is contained in:
@@ -69,6 +69,9 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||
|
||||
// Observe kThemeServiceDidChangeThemeNotification to handle user interface theme change.
|
||||
__weak id kThemeServiceDidChangeThemeNotificationObserver;
|
||||
|
||||
// Cancel handler of any ongoing loading indicator
|
||||
UserIndicatorCancel loadingIndicatorCancel;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) CreateRoomCoordinatorBridgePresenter *createRoomCoordinatorBridgePresenter;
|
||||
@@ -1305,7 +1308,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
[self stopActivityIndicator];
|
||||
[self.indicatorPresenter presentSuccessWithLabel:[VectorL10n roomParticipantsLeaveSuccess]];
|
||||
[self.userIndicatorStore presentSuccessWithLabel:[VectorL10n roomParticipantsLeaveSuccess]];
|
||||
// Force table refresh
|
||||
[self cancelEditionMode:YES];
|
||||
}
|
||||
@@ -2450,28 +2453,35 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||
#pragma mark - Activity Indicator
|
||||
|
||||
- (BOOL)providesCustomActivityIndicator {
|
||||
return self.indicatorPresenter != nil;
|
||||
return self.userIndicatorStore != nil;
|
||||
}
|
||||
|
||||
- (void)startActivityIndicatorWithLabel:(NSString *)label {
|
||||
if (self.indicatorPresenter && isViewVisible) {
|
||||
[self.indicatorPresenter presentLoadingIndicatorWithLabel:label];
|
||||
if (self.userIndicatorStore && isViewVisible) {
|
||||
// The app is very liberal with calling `startActivityIndicator` (often not matched by corresponding `stopActivityIndicator`),
|
||||
// so there is no reason to keep adding new indicators if there is one already showing.
|
||||
if (loadingIndicatorCancel) {
|
||||
return;
|
||||
}
|
||||
|
||||
MXLogDebug(@"[RecentsViewController] Present loading indicator")
|
||||
loadingIndicatorCancel = [self.userIndicatorStore presentLoadingWithLabel:label isInteractionBlocking:NO];
|
||||
} else {
|
||||
[super startActivityIndicator];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)startActivityIndicator {
|
||||
if (self.indicatorPresenter && isViewVisible) {
|
||||
[self.indicatorPresenter presentLoadingIndicator];
|
||||
} else {
|
||||
[super startActivityIndicator];
|
||||
}
|
||||
[self startActivityIndicatorWithLabel:[VectorL10n homeSyncing]];
|
||||
}
|
||||
|
||||
- (void)stopActivityIndicator {
|
||||
if (self.indicatorPresenter) {
|
||||
[self.indicatorPresenter dismissLoadingIndicator];
|
||||
if (self.userIndicatorStore) {
|
||||
if (loadingIndicatorCancel) {
|
||||
MXLogDebug(@"[RecentsViewController] Present loading indicator")
|
||||
loadingIndicatorCancel();
|
||||
loadingIndicatorCancel = nil;
|
||||
}
|
||||
} else {
|
||||
[super stopActivityIndicator];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user