Introduced new ShareExtensionDelegate method didStartSendingToRoom to notify the viewController when the request is initiated to only then show the loading hud, block interaction with the view, etc

This commit is contained in:
Aram Sargsyan
2017-08-21 01:39:08 +04:00
parent 224cf039f1
commit b1ae853be4
3 changed files with 24 additions and 3 deletions
@@ -109,9 +109,7 @@
UIAlertAction *sendAction = [UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"send"] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
MXRoom *selectedRoom = [self.dataSource getRoomAtIndexPath:indexPath];
self.hudView = [MXKPieChartHUD showLoadingHudOnView:self.view WithMessage:NSLocalizedStringFromTable(@"sending", @"Vector", nil)];
[ShareExtensionManager sharedManager].delegate = self;
self.parentViewController.view.userInteractionEnabled = NO;
[[ShareExtensionManager sharedManager] sendContentToRoom:selectedRoom failureBlock:^{
[self showFailureAlert];
@@ -211,6 +209,13 @@
[self presentViewController:compressionPrompt animated:YES completion:nil];
}
- (void)shareExtensionManager:(ShareExtensionManager *)extensionManager didStartSendingContentToRoom:(MXRoom *)room
{
self.parentViewController.view.userInteractionEnabled = NO;
self.hudView = [MXKPieChartHUD showLoadingHudOnView:self.view WithMessage:NSLocalizedStringFromTable(@"sending", @"Vector", nil)];
[self.hudView setProgress:0.0];
}
- (void)shareExtensionManager:(ShareExtensionManager *)extensionManager mediaUploadProgress:(CGFloat)progress
{
[self.hudView setProgress:progress];