From 6f8759c501efe6a1d48a5d033c8d48572f3652fb Mon Sep 17 00:00:00 2001 From: Peter <> Date: Wed, 23 Oct 2019 22:29:14 +0400 Subject: [PATCH] Fix overlay status check --- .../Sources/OverlayStatusController.swift | 6 +++--- submodules/OverlayStatusController/Sources/ProxyWindow.h | 2 +- submodules/OverlayStatusController/Sources/ProxyWindow.m | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/submodules/OverlayStatusController/Sources/OverlayStatusController.swift b/submodules/OverlayStatusController/Sources/OverlayStatusController.swift index 82fd76fe5b..712a3297ec 100644 --- a/submodules/OverlayStatusController/Sources/OverlayStatusController.swift +++ b/submodules/OverlayStatusController/Sources/OverlayStatusController.swift @@ -92,13 +92,13 @@ private final class OverlayStatusControllerNode: ViewControllerTracingNode { case .success: self.contentController = .progress(ProgressWindowController(light: style == .light)) case let .shieldSuccess(text, increasedDelay): - self.contentController = .shieldSuccess(ProxyWindowController(light: style == .light, text: text, icon: ProxyWindowController.generateShieldImage(style == .light), isShield: true), increasedDelay) + self.contentController = .shieldSuccess(ProxyWindowController(light: style == .light, text: text, icon: ProxyWindowController.generateShieldImage(style == .light), isShield: true, showCheck: true), increasedDelay) case let .genericSuccess(text, increasedDelay): - let controller = ProxyWindowController(light: style == .light, text: text, icon: nil, isShield: false)! + let controller = ProxyWindowController(light: style == .light, text: text, icon: nil, isShield: false, showCheck: true)! self.contentController = .genericSuccess(controller, increasedDelay) isUserInteractionEnabled = false case let .starSuccess(text): - self.contentController = .genericSuccess(ProxyWindowController(light: style == .light, text: text, icon: UIImage(bundleImageName: "Star"), isShield: false), false) + self.contentController = .genericSuccess(ProxyWindowController(light: style == .light, text: text, icon: UIImage(bundleImageName: "Star"), isShield: false, showCheck: false), false) } super.init() diff --git a/submodules/OverlayStatusController/Sources/ProxyWindow.h b/submodules/OverlayStatusController/Sources/ProxyWindow.h index 2576321ac1..2c332921e5 100644 --- a/submodules/OverlayStatusController/Sources/ProxyWindow.h +++ b/submodules/OverlayStatusController/Sources/ProxyWindow.h @@ -2,7 +2,7 @@ @interface ProxyWindowController : UIViewController -- (instancetype)initWithLight:(bool)light text:(NSString *)text icon:(UIImage *)icon isShield:(bool)isShield; +- (instancetype)initWithLight:(bool)light text:(NSString *)text icon:(UIImage *)icon isShield:(bool)isShield showCheck:(bool)showCheck; - (void)dismissWithSuccess:(void (^)(void))completion increasedDelay:(bool)increasedDelay; - (void)updateLayout; diff --git a/submodules/OverlayStatusController/Sources/ProxyWindow.m b/submodules/OverlayStatusController/Sources/ProxyWindow.m index f3b3cefb13..c881313f0d 100644 --- a/submodules/OverlayStatusController/Sources/ProxyWindow.m +++ b/submodules/OverlayStatusController/Sources/ProxyWindow.m @@ -135,6 +135,7 @@ static bool ProxyWindowIsLight = true; NSString *_text; UIImage *_icon; bool _isShield; + bool _showCheck; UIVisualEffectView *_effectView; UIView *_backgroundView; ProxySpinnerView *_spinner; @@ -168,13 +169,14 @@ static bool ProxyWindowIsLight = true; return image; } -- (instancetype)initWithLight:(bool)light text:(NSString *)text icon:(UIImage *)icon isShield:(bool)isShield { +- (instancetype)initWithLight:(bool)light text:(NSString *)text icon:(UIImage *)icon isShield:(bool)isShield showCheck:(bool)showCheck { self = [super init]; if (self != nil) { _light = light; _text = text; _icon = icon; _isShield = isShield; + _showCheck = showCheck; } return self; } @@ -316,7 +318,7 @@ static bool ProxyWindowIsLight = true; dismissBlock(); }]; - if (_isShield) { + if (_isShield || _showCheck) { dispatchAfter(0.15, dispatch_get_main_queue(), ^{ [_spinner setSucceed]; });