diff --git a/frontend/components/Admin/AdminPanel/index.js b/frontend/components/Admin/AdminPanel/index.js
index ca1b511..8d195af 100644
--- a/frontend/components/Admin/AdminPanel/index.js
+++ b/frontend/components/Admin/AdminPanel/index.js
@@ -1,28 +1,36 @@
-import { useState, useEffect } from 'react'
-import { Spinner } from '@chakra-ui/react'
-import Grants from './Grants'
-import TokenBalance from './TokenBalance'
-import RecentActivity from '../../shared/RecentActivity'
-import { useRecoilState } from 'recoil'
-import { getGrants, fetchGrants } from '../../../lib/store/grants'
-import { eventsState, fetchEvents } from '../../../lib/store/events'
+import { useState, useEffect } from "react";
+import { Spinner } from "@chakra-ui/react";
+import Grants from "./Grants";
+import TokenBalance from "./TokenBalance";
+import RecentActivity from "../../shared/RecentActivity";
+import { useRecoilState } from "recoil";
+import { getGrants, fetchGrants } from "../../../lib/store/grants";
+import { eventsState, fetchEvents } from "../../../lib/store/events";
export default function AdminPanel() {
const [grants, setGrant] = useRecoilState(getGrants());
const [events, setEvents] = useRecoilState(eventsState);
const [loadingData, setLoadingData] = useState(true);
+ const { chain } = useNetwork();
+ const networkId = chain.id;
useEffect(() => {
- Promise.all([fetchEvents(setEvents), fetchGrants(setGrant)]).finally(() => {
- setLoadingData(false)
- })
- }, [])
-
- return loadingData ? : <>
-
-
-
- >
-
+ if (!networkId) return;
+ Promise.all([
+ fetchEvents(setEvents, networkId),
+ fetchGrants(setGrant, networkId),
+ ]).finally(() => {
+ setLoadingData(false);
+ });
+ }, [networkId]);
+ return loadingData ? (
+
+ ) : (
+ <>
+
+
+
+ >
+ );
}