Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nachocodoner committed Jul 22, 2024
1 parent 3c0ad07 commit 99e45d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/tasks-common/tasks-common.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const App = () => {
const lastTask = tasks[tasks.length - 1];

const onAddClick = useCallback(async () => {
const parts = lastTask?.description?.split(' ');
const nextTaskNum = (parseFloat(parts[parts.length - 1]) || 0) + 1;
const parts = lastTask?.description?.split(' ') || [];
const nextTaskNum = (parseFloat(parts[parts.length - 1] || '0') || 0) + 1;
await Meteor.callAsync('insertTask', { description: `New Task ${nextTaskNum}` });
if (!reactive) fetchTasks();
}, [reactive, lastTask?._id]);
Expand Down

0 comments on commit 99e45d5

Please sign in to comment.