File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ struct ImageViewerWrapper: View {
204
204
205
205
var body : some View {
206
206
Group {
207
- if let _ = info [ " mimeType " ] as? String {
207
+ if let _ = info [ " mimeType " ] as? String , ( info [ " needsDownloading " ] as! NSNumber ) . boolValue != true {
208
208
try ? ImageViewer ( delegate: dismisser, info: info)
209
209
} else {
210
210
Text ( " Invalid file data " )
Original file line number Diff line number Diff line change @@ -2378,7 +2378,10 @@ -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
2378
2378
} else {
2379
2379
dispatch_async (dispatch_get_main_queue (), ^{
2380
2380
NSDictionary * selectedItem = [MLFiletransfer getFileInfoForMessage: [self .messageList objectAtIndex: indexPath.row]];
2381
- NSMutableArray * allItems = [[DataLayer sharedInstance ] allAttachmentsFromContact: self .contact.contactJid forAccount: self .contact.accountID];
2381
+ NSMutableArray * allItems = [NSMutableArray new ];
2382
+ for (NSDictionary * info in [[DataLayer sharedInstance ] allAttachmentsFromContact: self .contact.contactJid forAccount: self .contact.accountID])
2383
+ if (!(((NSNumber *)nilDefault (info[" needsDownloading" ], YES )).boolValue ) && ([info[@" mimeType" ] hasPrefix: @" image/" ] || [info[@" mimeType" ] hasPrefix: @" video/" ])
2384
+ [allItems addObject: entry];
2382
2385
UIViewController* imageViewer = [[SwiftuiInterface new ] makeImageViewerForCurrentItem: selectedItem allItems: allItems];
2383
2386
imageViewer.modalPresentationStyle = UIModalPresentationOverFullScreen;
2384
2387
[self presentViewController: imageViewer animated: YES completion: ^{}];
@@ -2388,7 +2391,8 @@ -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
2388
2391
}
2389
2392
}
2390
2393
2391
- -(void ) closePhotos {
2394
+ -(void ) closePhotos
2395
+ {
2392
2396
[self .navigationController dismissViewControllerAnimated: YES completion: nil ];
2393
2397
}
2394
2398
You can’t perform that action at this time.
0 commit comments