diff --git a/explorer/src/constants/columns/portal.tsx b/explorer/src/constants/columns/portal.tsx index 7231b875..5f0e8d69 100644 --- a/explorer/src/constants/columns/portal.tsx +++ b/explorer/src/constants/columns/portal.tsx @@ -6,6 +6,7 @@ import { Chain } from "viem"; import { TdHandler } from "@/components/DataTable/components/TdHandler"; import { HelperIndicator } from "@/components/HelperIndicator"; import { Link } from "@/components/Link"; +import { EMPTY_0X_STRING, EMPTY_STRING, ZERO } from "@/constants"; import { toPortalById } from "@/routes/constants"; import { getBlockExplorerLink } from "@/utils"; import { cropString } from "@/utils/stringUtils"; @@ -73,11 +74,11 @@ export const skeletonPortals = (count: number) => .fill(null) .map((_, index) => ({ id: `0x${index.toString(16).padStart(40, "0")}` as `0x${string}`, - name: "", - description: "", - ownerAddress: "0x0000000000000000000000000000000000000000" as `0x${string}`, - ownerName: "", + name: EMPTY_STRING, + description: EMPTY_STRING, + ownerAddress: `${EMPTY_0X_STRING}${"0".repeat(40)}` as `0x${string}`, + ownerName: EMPTY_STRING, modules: [] as `0x${string}`[], isRevocable: false, - attestationCounter: 0, + attestationCounter: ZERO, })); diff --git a/explorer/src/pages/Module/components/ModulePortals/index.tsx b/explorer/src/pages/Module/components/ModulePortals/index.tsx index da8cff96..7aa5f0ad 100644 --- a/explorer/src/pages/Module/components/ModulePortals/index.tsx +++ b/explorer/src/pages/Module/components/ModulePortals/index.tsx @@ -20,9 +20,8 @@ export const ModulePortals: React.FC<{ moduleId: Address }> = ({ moduleId }) => const { data: portals, isLoading } = useSWR( `${SWRKeys.GET_MODULE_PORTAL_LIST}/${moduleId}/${chain.id}`, async () => { - const allPortals = await sdk.portal.findBy(100, 0); - const portalList = allPortals.filter((portal) => portal.modules.includes(moduleId)); - return portalList.slice(0, 5).map((portal) => ({ + const portalList = await sdk.portal.findBy(5, 0, { modules_contains: [moduleId] }, "attestationCounter", "desc"); + return portalList.map((portal) => ({ ...portal, id: portal.id as `0x${string}`, }));