From ccfc118cf162a15526cb22aa3aae244d9c580ae7 Mon Sep 17 00:00:00 2001 From: Joel Jeremy Marquez Date: Wed, 13 Nov 2024 23:41:09 -0800 Subject: [PATCH] Code rabbit --- packages/loot-core/src/client/data-hooks/schedules.tsx | 2 +- packages/loot-core/src/client/data-hooks/transactions.ts | 2 +- packages/loot-core/src/client/query-hooks.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/loot-core/src/client/data-hooks/schedules.tsx b/packages/loot-core/src/client/data-hooks/schedules.tsx index fbf1a85a675..6207b6304a8 100644 --- a/packages/loot-core/src/client/data-hooks/schedules.tsx +++ b/packages/loot-core/src/client/data-hooks/schedules.tsx @@ -66,7 +66,7 @@ type UseSchedulesResult = ScheduleData & { export function useSchedules({ query, }: UseSchedulesProps = {}): UseSchedulesResult { - const [isLoading, setIsLoading] = useState(query != null); + const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(undefined); const [data, setData] = useState({ schedules: [], diff --git a/packages/loot-core/src/client/data-hooks/transactions.ts b/packages/loot-core/src/client/data-hooks/transactions.ts index 202369eac00..60ec93e1f2d 100644 --- a/packages/loot-core/src/client/data-hooks/transactions.ts +++ b/packages/loot-core/src/client/data-hooks/transactions.ts @@ -34,7 +34,7 @@ export function useTransactions({ query, options = { pageCount: 50 }, }: UseTransactionsProps): UseTransactionsResult { - const [isLoading, setIsLoading] = useState(query != null); + const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(undefined); const [transactions, setTransactions] = useState< ReadonlyArray diff --git a/packages/loot-core/src/client/query-hooks.ts b/packages/loot-core/src/client/query-hooks.ts index 0dc6d92c073..e5ea7449dc9 100644 --- a/packages/loot-core/src/client/query-hooks.ts +++ b/packages/loot-core/src/client/query-hooks.ts @@ -21,12 +21,12 @@ export function useQuery( const query = useMemo(makeQuery, dependencies); const [data, setData] = useState | null>(null); - const [isLoading, setIsLoading] = useState(query != null); + const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(undefined); useEffect(() => { setError(query === null ? new Error('Query is null') : undefined); - setIsLoading(query !== null); + setIsLoading(!!query); if (!query) { return;