Skip to content

Commit

Permalink
Selecting a favorite task changes taskRequests, instead of append (#761)
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth authored Aug 31, 2023
1 parent aab9408 commit 274ca26
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions packages/react-components/lib/tasks/create-task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -973,17 +973,14 @@ export function CreateTaskForm({
setOpenDialog={setOpenFavoriteDialog}
listItemClick={() => {
setFavoriteTaskBuffer(favoriteTask);
setTaskRequests((prev) => {
return [
...prev,
{
category: favoriteTask.category,
description: favoriteTask.description,
unix_millis_earliest_start_time: Date.now(),
priority: favoriteTask.priority,
},
];
});
setTaskRequests([
{
category: favoriteTask.category,
description: favoriteTask.description,
unix_millis_earliest_start_time: Date.now(),
priority: favoriteTask.priority,
}]
);
}}
/>
);
Expand Down

0 comments on commit 274ca26

Please sign in to comment.