feat(pomodoro): go to work view when starting session #32

This commit is contained in:
Johannes Millan 2018-01-05 23:07:20 +01:00
parent 67e301ac6c
commit 76cfd2ba12
3 changed files with 13 additions and 1 deletions

View file

@ -127,6 +127,7 @@
isStopTrackingOnLongBreak: true,
isShowDistractionsOnBreak: true,
isPlaySound: true,
isGoToWorkView: true,
},
isTakeABreakEnabled: false,
takeABreakMinWorkingTime: undefined,

View file

@ -18,12 +18,13 @@
class PomodoroButton {
/* @ngInject */
constructor($rootScope, $interval, $q, Dialogs, Tasks, SimpleToast, LS_DEFAULTS, EV, IS_ELECTRON, Notifier) {
constructor($rootScope, $interval, $q, Dialogs, Tasks, SimpleToast, LS_DEFAULTS, EV, IS_ELECTRON, Notifier, $state) {
this.LS_DEFAULTS = LS_DEFAULTS;
this.IS_ELECTRON = IS_ELECTRON;
this.EV = EV;
this.$rootScope = $rootScope;
this.$interval = $interval;
this.$state = $state;
this.$q = $q;
this.Dialogs = Dialogs;
this.SimpleToast = SimpleToast;
@ -102,6 +103,10 @@
this.selectTask()
.then(() => {
this.start();
if (this.config.isGoToWorkView) {
this.$state.go('work-view');
}
});
}

View file

@ -110,6 +110,12 @@
ng-model="vm.settings.pomodoro.cyclesBeforeLongerBreak">
</md-input-container>
<div>
<md-switch ng-model="vm.settings.pomodoro.isGoToWorkView"
aria-label="Go to work view when starting a session">
Go to work view when starting a session
</md-switch>
</div>
<div>
<md-switch ng-model="vm.settings.pomodoro.isStopTrackingOnBreak"
aria-label="Pause time tracking on pomodoro break">