Skip to content

Commit

Permalink
Fix opening an otpauth URL with FreeOTP closed
Browse files Browse the repository at this point in the history
Ensures that the navigation heirachy is ready before pushing
controllers onto the stack, allowing correct presentation of the Scan
Token Wizard.
  • Loading branch information
justin-stephenson committed Jun 1, 2020
1 parent 25303e5 commit 5b35edb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions FreeOTP/ScanViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ class ScanViewController : UIViewController, AVCaptureMetadataOutputObjectsDeleg
return
}

orient(UIApplication.shared.statusBarOrientation)
}

override func viewDidAppear(_ animated: Bool) {
enabled = true
if urlSent {
urlSent = false
if !pushNextViewController(urlc) {
TokenStore().add(urlc)
switch UIDevice.current.userInterfaceIdiom {
Expand All @@ -107,11 +113,6 @@ class ScanViewController : UIViewController, AVCaptureMetadataOutputObjectsDeleg
} else {
preview.session!.startRunning()
}
orient(UIApplication.shared.statusBarOrientation)
}

override func viewDidAppear(_ animated: Bool) {
enabled = true
}

override func viewDidDisappear(_ animated: Bool) {
Expand Down

0 comments on commit 5b35edb

Please sign in to comment.