diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/SleepTimer.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/SleepTimer.kt index a17c9a3..ebc6330 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/SleepTimer.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/SleepTimer.kt @@ -26,7 +26,7 @@ object SleepTimer { } context(Context) - fun startTimer() { + fun startTimer() = synchronized(this@SleepTimer) { val millisInFuture = config.sleepInTS - System.currentTimeMillis() + 1000L sleepTimer?.cancel() sleepTimer = object : CountDownTimer(millisInFuture, 1000) {