diff --git a/src/components/ListItem.tsx b/src/components/ListItem.tsx
index 09e3b68..df0597f 100644
--- a/src/components/ListItem.tsx
+++ b/src/components/ListItem.tsx
@@ -6,7 +6,7 @@ import { moreThan24HoursPassed } from "../utils";
interface Props {
item: ListItem;
- listPath: string | null;
+ listPath: string;
}
interface None {
kind: "none";
@@ -35,11 +35,6 @@ export function ListItemCheckBox({ item, listPath }: Props) {
// Temporarily store the updated check state
setUpdatedCheckState({ kind: "set", value: newCheckedState });
- if (!listPath) {
- toast.error("Error: listPath is missing or invalid.");
- return;
- }
-
try {
await toast.promise(updateItem(listPath, item), {
loading: `Marking ${item.name} as purchased!`,
diff --git a/src/components/forms/AddItemForm.tsx b/src/components/forms/AddItemForm.tsx
index a518822..59d17cb 100644
--- a/src/components/forms/AddItemForm.tsx
+++ b/src/components/forms/AddItemForm.tsx
@@ -6,7 +6,7 @@ import toast from "react-hot-toast";
import { useNavigate } from "react-router-dom";
interface Props {
- listPath: string | null;
+ listPath: string;
data: ListItem[];
}
@@ -90,82 +90,73 @@ export function AddItemForm({ listPath, data: unfilteredListItems }: Props) {
return (
Let's go look at your list!
-
- >
- )}
+
+ Let's go look at your list!
+
Hello from the /list
page!
Hello from the /manage-list
page!