Skip to content

Commit 690e4ba

Browse files
committed
don't lock screen during workout
1 parent d3fc5c0 commit 690e4ba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

FitCount/Workout/QuickPoseBasicView.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct QuickPoseBasicView: View {
4343
let exerciseTimer = TimerManager()
4444

4545
@State var isInBBox = false
46-
@State var state = WorkoutState.bbox
46+
@State var state = WorkoutState.exercise
4747

4848
@State private var indicatorWidth: CGFloat = 0.0
4949

@@ -206,11 +206,15 @@ struct QuickPoseBasicView: View {
206206
overlayImage = nil
207207
}
208208
})
209-
}.onDisappear {
209+
}.onAppear() {
210+
UIApplication.shared.isIdleTimerDisabled = true
211+
}
212+
.onDisappear {
210213
let sessionDataDump = SessionDataModel(exercise: exercise.name, count: Int(counter.getCount()), seconds: Int(exerciseTimer.getTotalSeconds()), date: Date())
211214
appendToJson(sessionData: sessionDataDump)
212215

213216
quickPose.stop()
217+
UIApplication.shared.isIdleTimerDisabled = false
214218
}
215219
}
216220
}

0 commit comments

Comments
 (0)