| 271 | }; |
| 272 | |
| 273 | const onTaskChange: Function = (type: string, key: string) => { |
| 274 | return (ev: any) => { |
| 275 | let value; |
| 276 | if (type === constants.inputType.SELECT) { |
| 277 | value = ev; |
| 278 | } else if (type === constants.inputType.INPUT) { |
| 279 | value = ev.target.value; |
| 280 | } |
| 281 | if (value !== undefined && !!task.currentTask) { |
| 282 | task.currentTask[key] = value; |
| 283 | dispatch({ |
| 284 | type: 'task/saveCurrentTask', |
| 285 | payload: task.currentTask, |
| 286 | }); |
| 287 | } |
| 288 | }; |
| 289 | }; |
| 290 | |
| 291 | const getBadgeCount = (p: Platform) => { |
| 292 | const t = task.tasks.filter((d: Task) => d.platformId === p._id)[0]; |