mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-31 23:47:01 +00:00
Clear skipNextBiometricsRequest when entering background
This commit is contained in:
parent
70d5e0fabf
commit
7c7f8759a3
@ -47,6 +47,9 @@ final public class PasscodeEntryController: ViewController {
|
||||
private var hasOngoingBiometricsRequest = false
|
||||
private var skipNextBiometricsRequest = false
|
||||
|
||||
private var inBackground: Bool = false
|
||||
private var inBackgroundDisposable: Disposable?
|
||||
|
||||
public init(context: AccountContext, challengeData: PostboxAccessChallengeData, biometrics: PasscodeEntryControllerBiometricsMode, inShareExtension: Bool = false, arguments: PasscodeEntryControllerPresentationArguments) {
|
||||
self.context = context
|
||||
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||
@ -66,11 +69,23 @@ final public class PasscodeEntryController: ViewController {
|
||||
strongSelf.controllerNode.updatePresentationData(presentationData)
|
||||
}
|
||||
})
|
||||
|
||||
self.inBackgroundDisposable = (context.sharedContext.applicationBindings.applicationInForeground
|
||||
|> deliverOnMainQueue).start(next: { [weak self] value in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
strongSelf.inBackground = !value
|
||||
if !value {
|
||||
strongSelf.skipNextBiometricsRequest = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
deinit {
|
||||
self.presentationDataDisposable?.dispose()
|
||||
self.biometricsDisposable.dispose()
|
||||
self.inBackgroundDisposable?.dispose()
|
||||
}
|
||||
|
||||
required init(coder aDecoder: NSCoder) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user