refactor: use guard in handleProfileScan
This commit is contained in:
@@ -243,7 +243,10 @@ struct QRCodeView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func handleProfileScan(_ prof: String) {
|
func handleProfileScan(_ prof: String) {
|
||||||
if scannedCode != prof {
|
guard scannedCode != prof else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
generator.impactOccurred()
|
generator.impactOccurred()
|
||||||
cameraAnimate {
|
cameraAnimate {
|
||||||
scannedCode = prof
|
scannedCode = prof
|
||||||
@@ -257,7 +260,6 @@ struct QRCodeView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func cameraAnimate(completion: @escaping () -> Void) {
|
func cameraAnimate(completion: @escaping () -> Void) {
|
||||||
outerTrimEnd = 0.0
|
outerTrimEnd = 0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user