mirror of
https://github.com/Steffo99/todocolors.git
synced 2024-11-22 08:14:18 +00:00
Fix some typing
This commit is contained in:
parent
2209da9fd9
commit
7abc287c29
1 changed files with 2 additions and 1 deletions
|
@ -22,14 +22,15 @@ function boardReducer(state: BoardState, action: BoardAction | null) {
|
|||
}
|
||||
else if(Object.hasOwn(action, "Task")) {
|
||||
const taskAction = action as TaskBoardAction;
|
||||
const id = taskAction["Task"][0]
|
||||
const task = taskAction["Task"][1]
|
||||
const tasksById = {...state.tasksById}
|
||||
if(task === null) {
|
||||
const id = taskAction["Task"][0]
|
||||
console.debug("[boardReducer] Deleting task:", id)
|
||||
delete tasksById[id]
|
||||
}
|
||||
else {
|
||||
const id = taskAction["Task"][0] as string
|
||||
console.debug("[boardReducer] Putting task:", id)
|
||||
tasksById[id] = task
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue