From 1d5837a4f86712a183fbda6744887847a9ed21a6 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Tue, 28 Feb 2023 21:05:15 +0400 Subject: [PATCH] Various fixes --- .../Sources/PasscodeEntryControllerNode.swift | 5 ++++- .../TelegramUI/Sources/PeersNearbyManager.swift | 15 --------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/submodules/PasscodeUI/Sources/PasscodeEntryControllerNode.swift b/submodules/PasscodeUI/Sources/PasscodeEntryControllerNode.swift index d546047a88..daca869132 100644 --- a/submodules/PasscodeUI/Sources/PasscodeEntryControllerNode.swift +++ b/submodules/PasscodeUI/Sources/PasscodeEntryControllerNode.swift @@ -250,11 +250,14 @@ final class PasscodeEntryControllerNode: ASDisplayNode { self.background = CustomPasscodeBackground(size: size, colors: gradient.colors.compactMap { UIColor(rgb: $0) }, inverted: (gradient.settings.intensity ?? 0) < 0) case .image, .file: if let image = chatControllerBackgroundImage(theme: self.theme, wallpaper: self.wallpaper, mediaBox: self.accountManager.mediaBox, composed: false, knockoutMode: false) { + self.coverNode.backgroundColor = .black self.background = ImageBasedPasscodeBackground(image: image, size: size) } else { if case let .file(file) = self.wallpaper, !file.settings.colors.isEmpty { + self.coverNode.backgroundColor = file.settings.colors.last.flatMap { UIColor(rgb: $0) } self.background = CustomPasscodeBackground(size: size, colors: file.settings.colors.compactMap { UIColor(rgb: $0) }, inverted: (file.settings.intensity ?? 0) < 0) } else { + self.coverNode.backgroundColor = self.theme.passcode.backgroundColors.bottomColor self.background = GradientPasscodeBackground(size: size, backgroundColors: self.theme.passcode.backgroundColors.colors, buttonColor: self.theme.passcode.buttonColor) } } @@ -462,7 +465,7 @@ final class PasscodeEntryControllerNode: ASDisplayNode { let maxSide = max(layout.size.width, layout.size.height) let coverSize = CGSize(width: maxSide, height: maxSide) - self.coverNode.frame = CGRect(origin: CGPoint(x: round((layout.size.width - coverSize.width) / 2.0), y: round((layout.size.height - coverSize.height) / 2.0)), size: coverSize) + transition.updateFrame(node: self.coverNode, frame: CGRect(origin: CGPoint(x: round((layout.size.width - coverSize.width) / 2.0), y: round((layout.size.height - coverSize.height) / 2.0)), size: coverSize)) let bounds = CGRect(origin: CGPoint(), size: layout.size) transition.updateFrame(node: self.backgroundImageNode, frame: bounds) diff --git a/submodules/TelegramUI/Sources/PeersNearbyManager.swift b/submodules/TelegramUI/Sources/PeersNearbyManager.swift index 79f01e9cd8..8faddf9d12 100644 --- a/submodules/TelegramUI/Sources/PeersNearbyManager.swift +++ b/submodules/TelegramUI/Sources/PeersNearbyManager.swift @@ -41,21 +41,6 @@ final class PeersNearbyManagerImpl: PeersNearbyManager { strongSelf.visibilityUpdated(visible: visibility != nil) } }) - - self.accessDisposable = (DeviceAccess.authorizationStatus(applicationInForeground: nil, siriAuthorization: nil, subject: .location(.live)) - |> deliverOnMainQueue).start(next: { [weak self] status in - guard let strongSelf = self else { - return - } - switch status { - case .denied: - let _ = strongSelf.engine.peersNearby.updatePeersNearbyVisibility(update: .invisible, background: false).start() - strongSelf.locationDisposable.set(nil) - strongSelf.updateDisposable.set(nil) - default: - break - } - }) } deinit {