소스 검색

fixed preview ordering

nayooti 5 년 전
부모
커밋
5b54ba6d76
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      deltachat-ios/Controller/GalleryViewController.swift

+ 3 - 3
deltachat-ios/Controller/GalleryViewController.swift

@@ -188,10 +188,10 @@ extension GalleryViewController {
         guard let url = msg.fileURL, let index = mediaMessageIds.index(of: msgId) else {
             return
         }
-        let previousUrls: [URL] = msg.previousMediaURLs()
-        let nextUrls: [URL] = msg.nextMediaURLs()
+        let olderUrls: [URL] = msg.previousMediaURLs().reversed()
+        let newerUrls: [URL] = msg.nextMediaURLs().reversed()
         // these are the files user will be able to swipe trough
-        let mediaUrls: [URL] = previousUrls + [url] + nextUrls
+        let mediaUrls: [URL] = newerUrls + [url] + olderUrls
         let previewController = PreviewController(currentIndex: index, urls: mediaUrls)
         present(previewController, animated: true, completion: nil)
     }