1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-11 09:28:38 +00:00

Merge branch 'master' into hotfix/fixing-pomodoro-widget

This commit is contained in:
maandagdev 2020-01-24 01:27:58 +01:00 committed by GitHub
commit a362f4b4b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@ class PomodoroBarItem: CustomButtonTouchBarItem, Widget {
//Vars are used for pausing the timer.
private var started = false
private var timerPaused: Bool = false;
private var timerPaused: Bool = false
private let defaultTitle = ""
private let workTime: TimeInterval
@ -67,23 +67,22 @@ class PomodoroBarItem: CustomButtonTouchBarItem, Widget {
}
@objc func startStopWork() {
if !started {
started = true;
started = true
typeTime = .work
startStopTimer()
} else {
if timerPaused {
timerPaused = false;
resumeTimer();
timerPaused = false
resumeTimer()
} else {
timerPaused = true;
pauseTimer();
timerPaused = true
pauseTimer()
}
}
}
@objc func startStopRest() {
started = false;
started = false
typeTime = .rest
startStopTimer()
}
@ -94,12 +93,12 @@ class PomodoroBarItem: CustomButtonTouchBarItem, Widget {
func resumeTimer() {
guard let timervalue = timer else { return }
timervalue.resume();
timervalue.resume()
}
func pauseTimer() {
guard let timervalue = timer else { return }
timervalue.suspend();
timervalue.suspend()
}
private func start() {