Skip to content

Commit

Permalink
Merge pull request #11 from egargo/dev
Browse files Browse the repository at this point in the history
pomoduro: 0.3.0
  • Loading branch information
egargo authored Oct 1, 2023
2 parents e205dab + b65c3fd commit 0849fed
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/js/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ pomoduroTimer.innerText =
? pomoduroStudyTime + ':00'
: pomoduroStudyTime + ':00';

const pomoduroReset = (timerMode) => {
const pomoduroReset = () => {
document.title = 'POMODURO';

if (timerMode === 'study') {
if(pomoduroTimer.getAttribute('name') === 'study') {
countDown = pomoduroStudyTime * 60;
pomoduroTimer.innerText = pomoduroStudyTime + ':00';
} else {
Expand Down Expand Up @@ -94,18 +94,26 @@ const pomoDuroStartTimer = () => {
);
}

pomoDuroResetTimer(pomoduroTimer.getAttribute('name'));
pomoDuroResetTimer();
pomoduroReset();
}
}, 1000);
};

const pomoDuroResetTimer = (timerMode) => {
const pomoDuroResetTimer = () => {
enableButton(timerControlButton, '▶️ START');
enableButton(pomodoro_study, '💻 Study');
enableButton(pomodoro_break, '☕ Break');

updateButton();
clearInterval(intervalID);
pomoduroReset(timerMode);
pomoduroReset();
};

const updateButton = () => {
timerControlButton.onclick = () => {
pomoDuroStartTimer();
};
};

(function() {
Expand Down

0 comments on commit 0849fed

Please sign in to comment.