bug fixes

This commit is contained in:
2021-11-12 12:05:44 -03:00
parent 5ad9a1581c
commit 65f81a0dbc
4 changed files with 35 additions and 3 deletions

2
netlify.toml Normal file
View 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

View File

@@ -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) {

View File

@@ -1,5 +1,3 @@
import React from 'react'
const detectKeys = (setKonamiCodeActive) => {
let secuencie = []