Skip to content

Commit ec64d53

Browse files
committed
fix lit for unsupported chain on builder
1 parent 1806aad commit ec64d53

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

packages/builder/src/actions/grantsMetadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const fetchGrantData =
132132
alloVersion: config.allo.version,
133133
});
134134

135-
if (!result?.project) {
135+
if (!result?.project || !result?.project.metadata.title) {
136136
return;
137137
}
138138

packages/builder/src/actions/projects.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ export const loadProjects =
187187

188188
if (projects && withMetaData) {
189189
projects.forEach((project) => {
190-
dispatch<any>(transformAndDispatchProject(project.id, project));
190+
if (project.metadata.title) {
191+
dispatch<any>(transformAndDispatchProject(project.id, project));
192+
}
191193
});
192194
}
193195

packages/builder/src/actions/roundApplication.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ export const submitApplication =
330330

331331
deterministicApplication = objectToDeterministicJSON(application as any);
332332
} catch (error) {
333+
console.error("error building round application", error);
333334
dispatchAndLogApplicationError(
334335
dispatch,
335336
roundId,

packages/builder/src/utils/RoundApplicationBuilder.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import {
22
RoundApplicationAnswers,
33
RoundApplicationMetadata,
44
} from "data-layer/dist/roundApplication.types";
5+
import { isLitUnavailable } from "common";
56
import Lit from "../services/lit";
67
import { Project, RoundApplication } from "../types";
8+
import { global } from "../global";
79

810
export default class RoundApplicationBuilder {
911
enableEncryption: boolean;
@@ -98,7 +100,7 @@ export default class RoundApplicationBuilder {
98100
let answer;
99101
// eslint-disable-next-line
100102
let encryptedAnswer;
101-
if (question.encrypted) {
103+
if (question.encrypted && !isLitUnavailable(global.chainID!)) {
102104
// eslint-disable-next-line
103105
encryptedAnswer = await this.encryptAnswer(
104106
(formInputs[question.id] as string) ?? ""

packages/common/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ export function isLitUnavailable(chainId: number) {
483483
42, // LUKSO,
484484
713715, // SEI_DEVNET,
485485
1329, // SEI_MAINNET,
486+
1088, // METIS
486487
].includes(chainId);
487488
}
488489

0 commit comments

Comments
 (0)