Skip to content

Commit

Permalink
refactor: cancel schedule check if timer is active
Browse files Browse the repository at this point in the history
  • Loading branch information
AXeL-dev committed Feb 27, 2022
1 parent f4fd951 commit 2f5f27d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/Background/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,12 @@ export class Background extends Component {
whitelist: this.whitelist,
});
// Handle schedule
const { isAllowedTime, todaySchedule } = this.parseTodaySchedule();
if (isAllowedTime && !this.isTimerActive()) {
this.debug('not in scheduled blocking time:', todaySchedule);
return;
if (!this.isTimerActive()) {
const { isAllowedTime, todaySchedule } = this.parseTodaySchedule();
if (isAllowedTime) {
this.debug('not in scheduled blocking time:', todaySchedule);
return;
}
}
// Handle blocking
const shouldBlock = this.isUrlBlocked(data.url);
Expand Down

0 comments on commit 2f5f27d

Please sign in to comment.