mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
feat: update task with all repeat cfg value after first making it repeatable #3101
This commit is contained in:
parent
c0cb8f6e26
commit
d915efb42c
1 changed files with 23 additions and 1 deletions
|
|
@ -1,11 +1,13 @@
|
|||
import { Injectable, inject } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Actions, createEffect, ofType } from '@ngrx/effects';
|
||||
import {
|
||||
concatMap,
|
||||
delay,
|
||||
filter,
|
||||
first,
|
||||
map,
|
||||
mergeMap,
|
||||
switchMap,
|
||||
take,
|
||||
tap,
|
||||
withLatestFrom,
|
||||
|
|
@ -147,6 +149,26 @@ export class TaskRepeatCfgEffects {
|
|||
{ dispatch: false },
|
||||
);
|
||||
|
||||
updateTaskAfterMakingItRepeatable$: any = createEffect(
|
||||
() =>
|
||||
this._actions$.pipe(
|
||||
ofType(addTaskRepeatCfgToTask),
|
||||
switchMap(({ taskRepeatCfg, taskId }) => {
|
||||
return this._taskService.getByIdOnce$(taskId).pipe(
|
||||
first(),
|
||||
map((task) => ({
|
||||
task,
|
||||
taskRepeatCfg,
|
||||
})),
|
||||
);
|
||||
}),
|
||||
tap(({ task, taskRepeatCfg }) => {
|
||||
this._updateRegularTaskInstance(task, taskRepeatCfg, taskRepeatCfg);
|
||||
}),
|
||||
),
|
||||
{ dispatch: false },
|
||||
);
|
||||
|
||||
checkToUpdateAllTaskInstances: any = createEffect(
|
||||
() =>
|
||||
this._actions$.pipe(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue