Show an activity indicator until the preview has loaded.

This commit is contained in:
Doug
2021-09-02 17:37:48 +01:00
parent 8624e196e6
commit aace9d0a96
10 changed files with 88 additions and 32 deletions
@@ -82,10 +82,15 @@ typedef NS_ENUM(NSInteger, RoomBubbleCellDataTag)
@property(nonatomic, readonly) CGFloat additionalContentHeight;
/**
A link if the textMessage contains one, otherwise nil.
The data necessary to show a URL preview.
*/
@property (nonatomic) URLPreviewData *urlPreviewData;
/**
Whether a URL preview should be displayed for this cell.
*/
@property (nonatomic) BOOL showURLPreview;
/**
MXKeyVerification object associated to key verification event when using key verification by direct message.
*/
@@ -1070,8 +1070,9 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
return;
}
// Check that the preview hasn't been dismissed already.
if ([URLPreviewManager.shared hasClosedPreviewFrom:lastComponent.event])
// Don't show the preview if it has been dismissed already.
self.showURLPreview = ![URLPreviewManager.shared hasClosedPreviewFrom:lastComponent.event];
if (!self.showURLPreview)
{
return;
}