mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Fix more warnings
This commit is contained in:
@@ -457,12 +457,12 @@ public func serviceColor(for wallpaper: (TelegramWallpaper, UIImage?)) -> UIColo
|
||||
} else {
|
||||
return UIColor(rgb: 0x000000, alpha: 0.3)
|
||||
}
|
||||
case let .file(file):
|
||||
case let .file(_, _, _, _, _, _, _, _, settings):
|
||||
if wallpaper.0.isPattern {
|
||||
if file.settings.colors.count >= 1 && file.settings.colors.count <= 2 {
|
||||
var mixedColor = UIColor(argb: file.settings.colors[0])
|
||||
if file.settings.colors.count >= 2 {
|
||||
mixedColor = mixedColor.mixedWith(UIColor(argb: file.settings.colors[1]), alpha: 0.5)
|
||||
if settings.colors.count >= 1 && settings.colors.count <= 2 {
|
||||
var mixedColor = UIColor(argb: settings.colors[0])
|
||||
if settings.colors.count >= 2 {
|
||||
mixedColor = mixedColor.mixedWith(UIColor(argb: settings.colors[1]), alpha: 0.5)
|
||||
}
|
||||
return serviceColor(with: mixedColor)
|
||||
} else {
|
||||
@@ -531,12 +531,12 @@ public func chatServiceBackgroundColor(wallpaper: TelegramWallpaper, mediaBox: M
|
||||
} else {
|
||||
return .single(UIColor(rgb: 0x000000, alpha: 0.3))
|
||||
}
|
||||
case let .file(file):
|
||||
case let .file(_, _, _, _, _, _, _, file, settings):
|
||||
if wallpaper.isPattern {
|
||||
if file.settings.colors.count >= 1 && file.settings.colors.count <= 2 {
|
||||
var mixedColor = UIColor(argb: file.settings.colors[0])
|
||||
if file.settings.colors.count >= 2 {
|
||||
mixedColor = mixedColor.mixedWith(UIColor(argb: file.settings.colors[1]), alpha: 0.5)
|
||||
if settings.colors.count >= 1 && settings.colors.count <= 2 {
|
||||
var mixedColor = UIColor(argb: settings.colors[0])
|
||||
if settings.colors.count >= 2 {
|
||||
mixedColor = mixedColor.mixedWith(UIColor(argb: settings.colors[1]), alpha: 0.5)
|
||||
}
|
||||
return .single(serviceColor(with: mixedColor))
|
||||
} else {
|
||||
@@ -544,7 +544,7 @@ public func chatServiceBackgroundColor(wallpaper: TelegramWallpaper, mediaBox: M
|
||||
}
|
||||
} else {
|
||||
return Signal<UIColor, NoError> { subscriber in
|
||||
let data = serviceColor(for: mediaBox.resourceData(file.file.resource)).start(next: { next in
|
||||
let data = serviceColor(for: mediaBox.resourceData(file.resource)).start(next: { next in
|
||||
subscriber.putNext(next)
|
||||
}, completed: {
|
||||
subscriber.putCompletion()
|
||||
@@ -625,7 +625,7 @@ public func updatedPresentationData(accountManager: AccountManager, applicationI
|
||||
switch effectiveChatWallpaper {
|
||||
case .builtin, .color, .gradient:
|
||||
effectiveChatWallpaper = themeValue.chat.defaultWallpaper
|
||||
case let .file(file):
|
||||
case .file:
|
||||
if effectiveChatWallpaper.isPattern {
|
||||
effectiveChatWallpaper = themeValue.chat.defaultWallpaper
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user