mirror of
https://github.com/FranP-code/Pomodoro-Timer-with-Clockify-integration.git
synced 2025-10-12 23:52:30 +00:00
Dinamic favicon add
This commit is contained in:
@@ -216,6 +216,12 @@ const MainPomodoroTimer = (props) => {
|
||||
|
||||
})*/
|
||||
|
||||
const getFavicon = () => {
|
||||
const r = document.getElementById('favicon')
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
React.useEffect ( () => {
|
||||
let idTimeOut
|
||||
|
||||
@@ -224,6 +230,8 @@ const MainPomodoroTimer = (props) => {
|
||||
|
||||
if (!weAreInBreakTime) {
|
||||
|
||||
getFavicon().href = './img/working favicon.ico'
|
||||
|
||||
if (!alreadyCountingStart) {
|
||||
const time = getAndFormatCurrentTime()
|
||||
props.setStartTime(time)
|
||||
@@ -279,6 +287,8 @@ const MainPomodoroTimer = (props) => {
|
||||
|
||||
if(weAreInBreakTime) {
|
||||
|
||||
getFavicon().href = './img/rest favicon.ico'
|
||||
|
||||
if (minutes === 0 && seconds === 0) {
|
||||
setTimerActivity(false)
|
||||
|
||||
@@ -315,6 +325,8 @@ const MainPomodoroTimer = (props) => {
|
||||
|
||||
if (!props.timerOn) {
|
||||
|
||||
getFavicon().href = './img/favicon.ico'
|
||||
|
||||
if ( timerActivity === true) {
|
||||
|
||||
if (!weAreInBreakTime) {
|
||||
|
||||
@@ -3,8 +3,6 @@ import MainPomodoroTimer from './Main Pomodoro Childrens/MainPomodoroTimer'
|
||||
import PomodoroCounter from './Main Pomodoro Childrens/PomodoroCounter'
|
||||
import StyleSelector from './Main Pomodoro Childrens/StyleSelector'
|
||||
import uploadToClockifyTimer from './Clockify/uploadToClockifyTimer'
|
||||
import react from 'react'
|
||||
|
||||
|
||||
const MainPomodoro = (props) => {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user