Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 63f9e11

Browse files
authored
HOTFIX: disable opportunity fetching in loader to prevent crashes (#143)
* HOTFIX: disable opportunity fetching in loader to prevent crashes * lint
1 parent acd90ab commit 63f9e11

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

src/modules/opportunity/routes/opportunity.$chain.$type.$id.campaigns.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ import { api } from "@core/api";
22
import type { MerklServerContext } from "@core/app/server/context";
33
import { ErrorContent } from "@core/components/layout/ErrorContent";
44
import { ChainService } from "@core/modules/chain/chain.service";
5-
import { InteractionService } from "@core/modules/interaction/interaction.service";
65
import type { OutletContextOpportunity } from "@core/modules/opportunity/routes/opportunity.$chain.$type.$id.header";
7-
import type { Opportunity } from "@merkl/api";
86
import { Container, Group } from "dappkit";
97
import { Outlet, useLoaderData, useOutletContext } from "react-router";
108
import type { LoaderFunctionArgs } from "react-router";
119
import OpportunityBoxParticipate from "../components/element/OpportunityBoxParticipate";
12-
import { OpportunityService } from "../opportunity.service";
1310

1411
export async function loader({
1512
context: { backend },
@@ -19,16 +16,16 @@ export async function loader({
1916
if (!chainId || !id || !type) throw "";
2017

2118
const chain = await ChainService({ api, request, backend }).get({ name: chainId });
22-
const opportunity = (await OpportunityService({ api, request, backend }).getCampaignsByParams({
23-
chainId: chain.id,
24-
type: type,
25-
identifier: id,
26-
})) as unknown as Opportunity;
27-
28-
const targets = await InteractionService({ api, backend }).getTargetsByOpportunity(opportunity as Opportunity);
19+
// DISABLED FOR NOW (Crashing on opp identifier different from blockchain address)
20+
// const opportunity = (await OpportunityService({ api, request, backend }).getCampaignsByParams({
21+
// chainId: chain.id,
22+
// type: type,
23+
// identifier: id,
24+
// })) as unknown as Opportunity;
25+
// const targets = await InteractionService({ api, backend }).getTargetsByOpportunity(opportunity as Opportunity);
2926

3027
return {
31-
targets,
28+
targets: [],
3229
};
3330
}
3431

0 commit comments

Comments
 (0)