feat(pomodoro): add option to play sound when break ends #138

This commit is contained in:
Johannes Millan 2019-02-10 13:17:54 +01:00
parent 7dd7037dc3
commit 6ca5db2cab
4 changed files with 10 additions and 1 deletions

View file

@ -54,6 +54,7 @@ export type PomodoroConfig = Readonly<{
isStopTrackingOnLongBreak: boolean;
isManualContinue: boolean;
isPlaySound: boolean;
isPlaySoundAfterBreak: boolean;
// isGoToWorkView: boolean;
isPlayTick: boolean;

View file

@ -25,6 +25,7 @@ export const DEFAULT_CFG: GlobalConfig = {
isStopTrackingOnLongBreak: true,
isManualContinue: false,
isPlaySound: true,
isPlaySoundAfterBreak: false,
// isGoToWorkView: false,
isPlayTick: false,
},

View file

@ -46,6 +46,13 @@ export const POMODORO_FORM_CFG: ConfigFormSection = {
label: 'Play sound when session is done',
},
},
{
key: 'isPlaySoundAfterBreak',
type: 'checkbox',
templateOptions: {
label: 'Play sound when break is done',
},
},
{
key: 'isPlayTick',
type: 'checkbox',

View file

@ -86,7 +86,7 @@ export class PomodoroEffects {
),
filter(isEnabled),
filter(([action, cfg, isBreak]: [FinishPomodoroSession, PomodoroConfig, boolean]) =>
cfg.isPlaySound && isBreak),
(cfg.isPlaySound && isBreak) || (cfg.isPlaySoundAfterBreak && !isBreak)),
tap(() => this._pomodoroService.playSessionDoneSound()),
);