This repository was archived by the owner on Dec 26, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
screens/projects/components/TaskNode Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export class RootStore {
2020 }
2121
2222 deleteProject ( project : ProjectModel ) {
23- this . tasksStore . deleteProjectTasks ( project . key ) ;
23+ this . tasksStore . removeProjectTasks ( project . key ) ;
2424 this . projectStore . delete ( project ) ;
2525 }
2626}
Original file line number Diff line number Diff line change @@ -114,12 +114,14 @@ export default class TaskStore {
114114 ) ;
115115 }
116116
117- delete ( task : TaskModel ) {
117+ remove ( task : TaskModel ) {
118118 function condition ( _task : TaskModel ) {
119119 return _task . key === task . key ;
120120 }
121121
122- this . stopTimer ( ) ;
122+ if ( task . active ) {
123+ this . stopTimer ( ) ;
124+ }
123125
124126 for ( const projectKey in this . tasks ) {
125127 if ( this . tasks . hasOwnProperty ( projectKey ) ) {
@@ -134,7 +136,7 @@ export default class TaskStore {
134136 GaService . event ( EEventCategory . Tasks , ETasksEvents . Delete ) ;
135137 }
136138
137- deleteProjectTasks ( projectKey : string ) {
139+ removeProjectTasks ( projectKey : string ) {
138140 delete this . tasks [ projectKey ] ;
139141 this . tasksService . save ( this . tasks ) ;
140142 this . updateVersion ( ) ;
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ export default observer(function TaskNode({ task }: TaskNodeProps) {
6868 ) }
6969 < Popconfirm
7070 title = "Are you sure to delete this task?"
71- onConfirm = { stopPropagationAndRun ( ( ) => tasksStore . delete ( task ) ) }
71+ onConfirm = { stopPropagationAndRun ( ( ) => tasksStore . remove ( task ) ) }
7272 onCancel = { stopPropagation }
7373 okText = "Yes"
7474 cancelText = "No"
You can’t perform that action at this time.
0 commit comments