diff --git a/src/components/MainPage.tsx b/src/components/MainPage.tsx index 5ba318f..1b99687 100644 --- a/src/components/MainPage.tsx +++ b/src/components/MainPage.tsx @@ -22,12 +22,14 @@ const MainPage = ({ initialFeedId }: MainPageProps) => { const [sourceFeedData, setSourceFeedData] = useState(undefined); useEffect(() => { - setLoading(true); - fetch(`/api/mod-config/${initialFeedId}`) - .then((response) => response.json()) - .then((data) => modConfigSchema.parse(data)) - .then((initialModConfig) => setModConfig(initialModConfig)) - .catch(() => router.push("/")); + if (initialFeedId) { + setLoading(true); + fetch(`/api/mod-config/${initialFeedId}`) + .then((response) => response.json()) + .then((data) => modConfigSchema.parse(data)) + .then((initialModConfig) => setModConfig(initialModConfig)) + .catch(() => router.push("/")); + } }, [initialFeedId]); useEffect(() => {