Skip to content

Commit 4dc172d

Browse files
committed
Fix an issue with the confirmation screen shown more than once
1 parent f95fe7c commit 4dc172d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

WordPress/Classes/ViewRelated/QR Login/Coordinators/QRLoginScanningCoordinator.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ class QRLoginScanningCoordinator: NSObject {
44
let parentCoordinator: QRLoginParentCoordinator
55
let view: QRLoginScanningView
66
var cameraSession: QRCodeScanningSession
7+
private var didHandleToken = false
78

89
init(view: QRLoginScanningView, parentCoordinator: QRLoginParentCoordinator, cameraSession: QRCodeScanningSession = QRLoginCameraSession()) {
910
self.view = view
@@ -48,6 +49,9 @@ extension QRLoginScanningCoordinator {
4849
}
4950

5051
func didScanToken(_ token: QRLoginToken) {
52+
guard !didHandleToken else { return }
53+
didHandleToken = true // Prevents the subsequent captures.
54+
5155
parentCoordinator.track(.qrLoginScannerScannedCode)
5256

5357
// Give the user a tap to let them know they've successfully scanned the code

0 commit comments

Comments
 (0)