Skip to content

Commit 235906f

Browse files
committed
fix(mvp): console.warning and task-404
https://github.com/martis-git/learn-frontend/issues/279
1 parent f71a11c commit 235906f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/pages/task-details/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const TaskDetails = (props: Props) => {
1515

1616
if (loading) return <Spin />;
1717
if (error) return <Alert message={error.message || String(error)} type="error" showIcon />;
18-
if (!todo) return <>Not Found</>;
18+
// FIXME: more strict null case
19+
if (!todo || !todo?.id) return <Alert message="Task not found" type="error" showIcon />;
1920
return <TaskCard {...todo} />;
2021
}
2122

src/pages/tasks-list/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const TasksList = () => {
3434
{loading && <Spin className="loading--overlay" />}
3535
<ul>
3636
{query?.map((task) => (
37-
<li><TaskItem {...task} /></li>
37+
<li key={task?.id}><TaskItem {...task} /></li>
3838
))}
3939
{/* FIXME: yet (!query && !loading) */}
4040
{query?.length === 0 && (

0 commit comments

Comments
 (0)