Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
[FIX] Fixed issue that would prevent local files to load
Browse files Browse the repository at this point in the history
  • Loading branch information
eharrison committed Feb 3, 2021
1 parent 6f76bfd commit 12211b9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/dotLottieLoader/DotLottieLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public class DotLottieLoader {
/// - cache: Cache type
/// - completion: dotLottieFile
public static func download(from url: URL, cache: DotLottieCache, completion: @escaping (DotLottieFile?) -> Void) {
// file is not remote, so just read
guard url.isRemoteFile else {
DotLottieUtils.log("Local file [\(url.lastPathComponent)], trying to read")
completion(DotLottieFile(url: url, cache: cache))
return
}

// file is already either downloaded or decompressed, we don't need to proceed
guard cache.shouldDownload(from: url) else {
DotLottieUtils.log("Skipping download for [\(url.lastPathComponent)], trying to read instead")
Expand Down

0 comments on commit 12211b9

Please sign in to comment.