mirror of
https://github.com/FranP-code/Pomodoro-Timer-with-Clockify-integration.git
synced 2025-10-12 23:52:30 +00:00
bug fixes
This commit is contained in:
2
netlify.toml
Normal file
2
netlify.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[build]
|
||||
command = “CI= npm run build”
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -30,9 +30,27 @@ const MainPomodoroTimer = (props) => {
|
||||
|
||||
const [velocity, setVelocity] = useState(1)
|
||||
|
||||
const [notificationPermission, setNotificationPermission] = useState('')
|
||||
|
||||
const setTimeStyle = () => setTimeStyleExternal(props, setMinutes, setSeconds, setBreakTime, setActualStyle, breakTime)
|
||||
|
||||
const getPermisionDesktopNotification = async () => {
|
||||
|
||||
let permission = await Notification.requestPermission();
|
||||
|
||||
if (permission === 'granted') {
|
||||
|
||||
await setNotificationPermission(true)
|
||||
|
||||
} else {
|
||||
|
||||
setNotificationPermission(false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
React.useEffect (() => {
|
||||
|
||||
if (actualStyle !== props.style) {
|
||||
setTimeStyle()
|
||||
|
||||
@@ -44,6 +62,8 @@ const MainPomodoroTimer = (props) => {
|
||||
|
||||
setControlKonamiCode(false)
|
||||
}
|
||||
|
||||
getPermisionDesktopNotification()
|
||||
|
||||
})
|
||||
|
||||
@@ -167,6 +187,13 @@ const MainPomodoroTimer = (props) => {
|
||||
setTimerActivity(false)
|
||||
|
||||
playAudio('work')
|
||||
|
||||
|
||||
if (notificationPermission) {
|
||||
|
||||
new Notification('Pomodoro ended');
|
||||
}
|
||||
|
||||
|
||||
if (restCounter !== 3){
|
||||
|
||||
@@ -221,7 +248,12 @@ const MainPomodoroTimer = (props) => {
|
||||
setTimerActivity(false)
|
||||
|
||||
playAudio('rest')
|
||||
|
||||
|
||||
if (notificationPermission) {
|
||||
|
||||
new Notification('Rest ended');
|
||||
}
|
||||
|
||||
setTimeout( () => {
|
||||
|
||||
if (restCounter === 4) {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import React from 'react'
|
||||
|
||||
const detectKeys = (setKonamiCodeActive) => {
|
||||
|
||||
let secuencie = []
|
||||
|
||||
Reference in New Issue
Block a user