mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 13:38:21 +00:00
Fixed wallpaper representations upgrade
This commit is contained in:
parent
d76ae96f0c
commit
b6e2e46264
@ -139,7 +139,15 @@ public func upgradedAccounts(accountManager: AccountManager, rootPath: String) -
|
||||
if let path = mediaBox.completedResourcePath(file.file.resource), let data = try? Data(contentsOf: URL(fileURLWithPath: path), options: .mappedRead) {
|
||||
accountManager.mediaBox.storeResourceData(file.file.resource.id, data: data)
|
||||
let _ = accountManager.mediaBox.cachedResourceRepresentation(file.file.resource, representation: CachedScaledImageRepresentation(size: CGSize(width: 720.0, height: 720.0), mode: .aspectFit), complete: true, fetch: true).start()
|
||||
let _ = accountManager.mediaBox.cachedResourceRepresentation(file.file.resource, representation: CachedBlurredWallpaperRepresentation(), complete: true, fetch: true).start()
|
||||
if file.isPattern {
|
||||
if let color = file.settings.color, let intensity = file.settings.intensity {
|
||||
let _ = accountManager.mediaBox.cachedResourceRepresentation(file.file.resource, representation: CachedPatternWallpaperRepresentation(color: color, intensity: intensity), complete: true, fetch: true).start()
|
||||
}
|
||||
} else {
|
||||
if file.settings.blur {
|
||||
let _ = accountManager.mediaBox.cachedResourceRepresentation(file.file.resource, representation: CachedBlurredWallpaperRepresentation(), complete: true, fetch: true).start()
|
||||
}
|
||||
}
|
||||
}
|
||||
case let .image(representations, _):
|
||||
for representation in representations {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user