diff --git a/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx b/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx index 29cd3c30fde..51ae5964f6e 100644 --- a/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx +++ b/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx @@ -2,7 +2,6 @@ import React, { useState } from 'react'; import q, { runQuery } from 'loot-core/src/client/query-helpers'; import { send } from 'loot-core/src/platform/client/fetch'; -import { type SchedulesHandlers } from 'loot-core/src/server/schedules/types/handlers'; import { getRecurringDescription } from 'loot-core/src/shared/schedules'; import type { DiscoverScheduleEntity, @@ -130,10 +129,7 @@ export default function DiscoverSchedules({ modalProps: CommonModalProps; actions: BoundActions; }) { - const { data, isLoading } = useSendPlatformRequest('schedule/discover') as { - data: Awaited> | null; - isLoading: boolean; - }; + const { data, isLoading } = useSendPlatformRequest('schedule/discover'); const schedules = data || []; diff --git a/packages/desktop-client/src/hooks/useSendPlatformRequest.ts b/packages/desktop-client/src/hooks/useSendPlatformRequest.ts index aa621589d8b..d4967f58a10 100644 --- a/packages/desktop-client/src/hooks/useSendPlatformRequest.ts +++ b/packages/desktop-client/src/hooks/useSendPlatformRequest.ts @@ -8,7 +8,7 @@ export default function useSendPlatformRequest( args?: Parameters[0], options?: { catchErrors?: boolean }, ) { - const [data, setData] = useState(null); + const [data, setData] = useState>>(null); const [isLoading, setIsLoading] = useState(null); useEffect(() => { diff --git a/packages/loot-core/src/server/schedules/find-schedules.ts b/packages/loot-core/src/server/schedules/find-schedules.ts index 2d409d52a66..b2014306bbe 100644 --- a/packages/loot-core/src/server/schedules/find-schedules.ts +++ b/packages/loot-core/src/server/schedules/find-schedules.ts @@ -394,11 +394,10 @@ export async function findSchedules() { }, ); - const finalized = []; + const finalized: Awaited> = + []; for (let schedule of schedules) { finalized.push(await findStartDate(schedule)); } - return finalized as unknown as Awaited< - ReturnType - >; + return finalized; }