✨ (action) add pause button
This commit is contained in:
@@ -33,7 +33,7 @@ export const useTimer = () => {
|
||||
|
||||
const start = () => {
|
||||
timeState.value = 'started'
|
||||
notify('La session commence !')
|
||||
notify(seconds.value ? 'La session reprend !' : 'La session commence !')
|
||||
|
||||
stopwatchId = setInterval(() => {
|
||||
seconds.value++
|
||||
@@ -54,7 +54,7 @@ export const useTimer = () => {
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
const clear = () => {
|
||||
const pause = () => {
|
||||
timeState.value = 'stopped'
|
||||
if (stopwatchId) {
|
||||
clearInterval(stopwatchId)
|
||||
@@ -64,6 +64,10 @@ export const useTimer = () => {
|
||||
clearInterval(stopWatchSessionId)
|
||||
stopWatchSessionId = null
|
||||
}
|
||||
}
|
||||
|
||||
const clear = () => {
|
||||
pause()
|
||||
seconds.value = 0
|
||||
sessionSeconds.value = intervalSeconds.value
|
||||
isProgrammer1Turn.value = true
|
||||
@@ -72,6 +76,7 @@ export const useTimer = () => {
|
||||
return {
|
||||
interval,
|
||||
start,
|
||||
pause,
|
||||
clear,
|
||||
timeState,
|
||||
time,
|
||||
|
||||
Reference in New Issue
Block a user