diff --git a/packages/app/src/systems/Contract/machines/contractsMachine.ts b/packages/app/src/systems/Contract/machines/contractsMachine.ts index de76781fe..e3e07d751 100644 --- a/packages/app/src/systems/Contract/machines/contractsMachine.ts +++ b/packages/app/src/systems/Contract/machines/contractsMachine.ts @@ -44,7 +44,9 @@ export const contractsMachine = createMachine( }, }, failure: { - type: 'final', + after: { + 10000: 'fetching', + }, }, success: { type: 'final', @@ -64,7 +66,8 @@ export const contractsMachine = createMachine( null, MachineServices['fetchProjects']['data'] >({ - showError: true, + showError: false, + maxAttempts: 1, async fetch() { return EcosystemService.fetchProjects(); }, diff --git a/packages/app/src/systems/Ecosystem/services/ecosystem.ts b/packages/app/src/systems/Ecosystem/services/ecosystem.ts index 444cf32d5..df384a9d5 100644 --- a/packages/app/src/systems/Ecosystem/services/ecosystem.ts +++ b/packages/app/src/systems/Ecosystem/services/ecosystem.ts @@ -4,10 +4,13 @@ import { ECOSYSTEM_PROJECTS_URL } from '~/config'; // biome-ignore lint/complexity/noStaticOnlyClass: export class EcosystemService { static async fetchProjects() { - const data = (await ( - await fetch(ECOSYSTEM_PROJECTS_URL) - ).json()) as Array; + const res = await fetch(ECOSYSTEM_PROJECTS_URL); - return data; + if (res.ok) { + const data: EcosystemProject[] = await res.json(); + return data; + } + + return []; } }