mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Combo update
This commit is contained in:
@@ -294,30 +294,28 @@ func openResolvedUrlImpl(_ resolvedUrl: ResolvedUrl, context: AccountContext, ur
|
||||
|
||||
let signal: Signal<TelegramWallpaper, GetWallpaperError>
|
||||
var options: WallpaperPresentationOptions?
|
||||
var topColor: UIColor?
|
||||
var bottomColor: UIColor?
|
||||
var colors: [UInt32] = []
|
||||
var intensity: Int32?
|
||||
var rotation: Int32?
|
||||
switch parameter {
|
||||
case let .slug(slug, wallpaperOptions, firstColor, secondColor, intensityValue, rotationValue):
|
||||
case let .slug(slug, wallpaperOptions, colorsValue, intensityValue, rotationValue):
|
||||
signal = getWallpaper(network: context.account.network, slug: slug)
|
||||
options = wallpaperOptions
|
||||
topColor = firstColor
|
||||
bottomColor = secondColor
|
||||
colors = colorsValue
|
||||
intensity = intensityValue
|
||||
rotation = rotationValue
|
||||
controller = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: nil))
|
||||
present(controller!, nil)
|
||||
case let .color(color):
|
||||
signal = .single(.color(color.argb))
|
||||
case let .gradient(topColor, bottomColor, rotation):
|
||||
signal = .single(.gradient([topColor.argb, bottomColor.argb], WallpaperSettings(rotation: rotation)))
|
||||
case let .gradient(colors, rotation):
|
||||
signal = .single(.gradient(colors, WallpaperSettings(rotation: rotation)))
|
||||
}
|
||||
|
||||
let _ = (signal
|
||||
|> deliverOnMainQueue).start(next: { [weak controller] wallpaper in
|
||||
controller?.dismiss()
|
||||
let galleryController = WallpaperGalleryController(context: context, source: .wallpaper(wallpaper, options, topColor, bottomColor, intensity, rotation, nil))
|
||||
let galleryController = WallpaperGalleryController(context: context, source: .wallpaper(wallpaper, options, colors, intensity, rotation, nil))
|
||||
present(galleryController, nil)
|
||||
}, error: { [weak controller] error in
|
||||
controller?.dismiss()
|
||||
|
||||
Reference in New Issue
Block a user