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

Commit 74d059a

Browse files
thelostone-mc0xKurt
authored andcommitted
fix: allow user to syncPool when no evaluations are found
1 parent dac96ec commit 74d059a

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { Hex } from "viem";
22

33
import { PoolSummary, ProjectBanner } from "@/components";
4+
import { syncPool } from "@/mainAll";
45
import { Button, Icon, IconType } from "@/primitives";
56

67
import { EvaluationList } from "~checker/components";
78
import { useApplicationOverviewEvaluations, useInitialize } from "~checker/hooks";
89
import {
10+
goToApplicationEvaluationOverviewAction,
911
goToReviewApplicationsAction,
1012
goToSubmitApplicationEvaluationAction,
1113
useCheckerDispatchContext,
@@ -41,6 +43,14 @@ export const ApplicationEvaluationOverviewPage = ({
4143
dispatch(goToReviewApplicationsAction());
4244
};
4345

46+
const syncAndRefresh = async () => {
47+
await syncPool({
48+
chainId,
49+
alloPoolId: poolId,
50+
});
51+
dispatch(goToApplicationEvaluationOverviewAction({ projectId: applicationId }));
52+
};
53+
4454
const project = application.metadata.application.project;
4555

4656
return (
@@ -79,9 +89,14 @@ export const ApplicationEvaluationOverviewPage = ({
7989
{applicationEvaluations ? (
8090
<EvaluationList evaluations={applicationEvaluations} />
8191
) : (
82-
<p className="text-center text-lg">
83-
No evaluations have been submitted for this project yet.
84-
</p>
92+
<div className="flex flex-col items-center gap-8">
93+
<Button
94+
variant="outlined-success"
95+
value="Trigger AI evaluation"
96+
onClick={syncAndRefresh}
97+
/>
98+
<p className="text-lg">No evaluations have been submitted for this project yet.</p>
99+
</div>
85100
)}
86101
</div>
87102
<div className="flex items-center justify-center">

0 commit comments

Comments
 (0)