diff --git a/packages/desktop-client/src/hooks/useSyncedPrefs.ts b/packages/desktop-client/src/hooks/useSyncedPrefs.ts index 60478520229..ca8788ecb34 100644 --- a/packages/desktop-client/src/hooks/useSyncedPrefs.ts +++ b/packages/desktop-client/src/hooks/useSyncedPrefs.ts @@ -16,7 +16,7 @@ export function useSyncedPrefs(): [SyncedPrefs, SetSyncedPrefsAction] { const prefs = useMemo( () => - queryData.reduce( + (queryData ?? []).reduce( (carry, { id, value }) => ({ ...carry, [id]: value, diff --git a/packages/loot-core/src/client/query-hooks.tsx b/packages/loot-core/src/client/query-hooks.tsx index 930acfc5875..8e4f5810aa7 100644 --- a/packages/loot-core/src/client/query-hooks.tsx +++ b/packages/loot-core/src/client/query-hooks.tsx @@ -82,7 +82,7 @@ export function useQuery( makeQuery: () => Query, deps: DependencyList, ): { - data: Response; + data: null | Response; overrideData: (newData: Response) => void; isLoading: boolean; } { diff --git a/upcoming-release-notes/3460.md b/upcoming-release-notes/3460.md new file mode 100644 index 00000000000..b39dfcb9c9a --- /dev/null +++ b/upcoming-release-notes/3460.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MatisJanis] +--- + +SyncedPrefs: fix import prefs not reading correctly.