mirror of
https://github.com/Steffo99/todocolors.git
synced 2024-11-25 17:54: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")) {
|
else if(Object.hasOwn(action, "Task")) {
|
||||||
const taskAction = action as TaskBoardAction;
|
const taskAction = action as TaskBoardAction;
|
||||||
const id = taskAction["Task"][0]
|
|
||||||
const task = taskAction["Task"][1]
|
const task = taskAction["Task"][1]
|
||||||
const tasksById = {...state.tasksById}
|
const tasksById = {...state.tasksById}
|
||||||
if(task === null) {
|
if(task === null) {
|
||||||
|
const id = taskAction["Task"][0]
|
||||||
console.debug("[boardReducer] Deleting task:", id)
|
console.debug("[boardReducer] Deleting task:", id)
|
||||||
delete tasksById[id]
|
delete tasksById[id]
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
const id = taskAction["Task"][0] as string
|
||||||
console.debug("[boardReducer] Putting task:", id)
|
console.debug("[boardReducer] Putting task:", id)
|
||||||
tasksById[id] = task
|
tasksById[id] = task
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue