1
Fork 0
mirror of https://github.com/Steffo99/todocolors.git synced 2024-11-22 16:24:19 +00:00

Fix some typing

This commit is contained in:
Steffo 2023-08-04 17:44:22 +02:00
parent 2209da9fd9
commit 7abc287c29
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -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
} }