Skip to content

Commit

Permalink
feat(pomodoro): focus window on and after break or show notification …
Browse files Browse the repository at this point in the history
…for web
  • Loading branch information
johannesjo committed Feb 26, 2018
1 parent 31a25b1 commit 2f08642
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions app-src/scripts/dialogs/pomodoro-break/pomodoro-break-c.js
Expand Up @@ -14,7 +14,7 @@
.controller('PomodoroBreakCtrl', PomodoroBreakCtrl);

/* @ngInject */
function PomodoroBreakCtrl($mdDialog, $rootScope, theme, pomodoroData, pomodoroConfig, $scope, $timeout, IS_ELECTRON, PomodoroButton) {
function PomodoroBreakCtrl($mdDialog, $rootScope, theme, pomodoroData, pomodoroConfig, $scope, $timeout, IS_ELECTRON, PomodoroButton, Notifier) {
this.r = $rootScope.r;
this.theme = theme;
this.pomodoroData = pomodoroData;
Expand All @@ -23,6 +23,12 @@

if (IS_ELECTRON) {
window.ipcRenderer.send('SHOW_OR_FOCUS');
} else {
Notifier({
title: 'Pomodoro break started',
sound: true,
wait: true
});
}

if (this.pomodoroData.currentSessionTime) {
Expand All @@ -36,7 +42,15 @@

this.timeout = $timeout(() => {
this.isBreakDone = true;

if (IS_ELECTRON) {
window.ipcRenderer.send('SHOW_OR_FOCUS');
} else {
Notifier({
title: 'Pomodoro break ended',
sound: true,
wait: true
});
}
if (pomodoroConfig.isManualContinue) {
this.pomodoroData.currentSessionTime = 0;
PomodoroButton.pause();
Expand Down

0 comments on commit 2f08642

Please sign in to comment.