Skip to content

Commit 8425b01

Browse files
committed
Fix the safari pin bug on launch with YubiKey
1 parent a1e606c commit 8425b01

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Authenticator/UI/MainView.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,12 @@ struct MainView: View {
227227
}
228228
}
229229
.onChange(of: scenePhase) { phase in
230-
if phase == .active && didEnterBackground {
231-
didEnterBackground = false
230+
if phase == .active {
232231
model.start() // This is called when app becomes active
233-
} else if phase == .background {
234-
didEnterBackground = true
232+
} else if phase == .background || phase == .inactive {
233+
let _ = UIApplication.shared.beginBackgroundTask {
234+
model.stop()
235+
}
235236
model.stop()
236237
}
237238
}

0 commit comments

Comments
 (0)