mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Univeral links: Improved UX: Display a loading wheel while the app is gathering information from the hs about the universal link
This commit is contained in:
parent
dd4327b9ab
commit
998371317d
2 changed files with 91 additions and 62 deletions
|
@ -798,7 +798,15 @@
|
|||
|
||||
continueUserActivity = YES;
|
||||
}
|
||||
else if ([roomIdOrAlias hasPrefix:@"#"])
|
||||
else
|
||||
{
|
||||
// We will display something but we need to do some requests before.
|
||||
// So, come back to the home VC and show its loading wheel while processing
|
||||
[self restoreInitialDisplay:^{
|
||||
|
||||
[_homeViewController startActivityIndicator];
|
||||
|
||||
if ([roomIdOrAlias hasPrefix:@"#"])
|
||||
{
|
||||
// The alias may be not part of user's rooms states
|
||||
// Ask the HS to resolve the room alias into a room id and then retry
|
||||
|
@ -806,6 +814,9 @@
|
|||
MXKAccount* account = accountManager.activeAccounts.firstObject;
|
||||
[account.mxSession.matrixRestClient roomIDForRoomAlias:roomIdOrAlias success:^(NSString *roomId) {
|
||||
|
||||
// Note: the activity indicator will not disappear if the session is not ready
|
||||
[_homeViewController stopActivityIndicator];
|
||||
|
||||
// Check that 'fragment' has not been cancelled
|
||||
if ([universalLinkFragmentPending isEqualToString:fragment])
|
||||
{
|
||||
|
@ -819,9 +830,6 @@
|
|||
} failure:^(NSError *error) {
|
||||
NSLog(@"[AppDelegate] Universal link: Error: The home server failed to resolve the room alias (%@)", roomIdOrAlias);
|
||||
}];
|
||||
|
||||
// Let's say we are handling the case
|
||||
continueUserActivity = YES;
|
||||
}
|
||||
else if ([roomIdOrAlias hasPrefix:@"!"] && ((MXKAccount*)accountManager.activeAccounts.firstObject).mxSession.state != MXSessionStateRunning)
|
||||
{
|
||||
|
@ -846,9 +854,6 @@
|
|||
}
|
||||
}
|
||||
}];
|
||||
|
||||
// Let's say we are handling the case
|
||||
continueUserActivity = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -860,6 +865,9 @@
|
|||
RoomPreviewData *roomPreviewData;
|
||||
if (queryParams)
|
||||
{
|
||||
// Note: the activity indicator will not disappear if the session is not ready
|
||||
[_homeViewController stopActivityIndicator];
|
||||
|
||||
roomPreviewData = [[RoomPreviewData alloc] initWithRoomId:roomIdOrAlias emailInvitationParams:queryParams andSession:account.mxSession];
|
||||
[self showRoomPreview:roomPreviewData];
|
||||
}
|
||||
|
@ -869,10 +877,19 @@
|
|||
|
||||
// Try to get more information about the room before opening its preview
|
||||
[roomPreviewData fetchPreviewData:^(BOOL successed) {
|
||||
|
||||
// Note: the activity indicator will not disappear if the session is not ready
|
||||
[_homeViewController stopActivityIndicator];
|
||||
|
||||
[self showRoomPreview:roomPreviewData];
|
||||
}];
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
// Let's say we are handling the case
|
||||
continueUserActivity = YES;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -367,6 +367,18 @@
|
|||
[super setKeyboardHeight:keyboardHeight];
|
||||
}
|
||||
|
||||
- (void)startActivityIndicator
|
||||
{
|
||||
// Redirect the operation to main displayed VC
|
||||
[recentsViewController startActivityIndicator];
|
||||
}
|
||||
|
||||
- (void)stopActivityIndicator
|
||||
{
|
||||
// Redirect the operation to main displayed VC
|
||||
[recentsViewController stopActivityIndicator];
|
||||
}
|
||||
|
||||
#pragma mark - Override UIViewController+VectorSearch
|
||||
|
||||
- (void)setKeyboardHeightForBackgroundImage:(CGFloat)keyboardHeight
|
||||
|
|
Loading…
Reference in a new issue