Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Legacy timer trimming
Browse files Browse the repository at this point in the history
Removed unneccessary logic elements from saga' timer worker
  • Loading branch information
Askadar committed Feb 11, 2018
1 parent 63aa397 commit 7e27d7c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/saga/timer.js
Expand Up @@ -33,16 +33,10 @@ function* ticking(action) {
let timePrev = Date.now();
const { cancelled } = yield race({
ticked: call(delay, Math.round(Math.random() * 8) + 16),
cancelled: race({
paused: take(pause),
stopped: take(types.stopped)
}),
cancelled: take([pause, types.stopped]),
});
if (cancelled) {
if (cancelled.stopped && !cancelled.stopped.finished)
yield fork(stopTimer);
if (cancelled)
break;
}
timeElapsed += Date.now() - timePrev;
if (!notifications.firstPomo && timeElapsed > pomoTime * 5e2){
notifications.firstPomo = true;
Expand Down

0 comments on commit 7e27d7c

Please sign in to comment.