From 121080655063fd334080eeea0f8c84625d02c571 Mon Sep 17 00:00:00 2001 From: Joel Jeremy Marquez Date: Fri, 2 Feb 2024 23:51:03 -0800 Subject: [PATCH] Fix hooks deps --- packages/desktop-client/src/hooks/useAccount.ts | 2 +- packages/desktop-client/src/hooks/useDateFormat.ts | 2 +- packages/desktop-client/src/hooks/usePayee.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/desktop-client/src/hooks/useAccount.ts b/packages/desktop-client/src/hooks/useAccount.ts index 619c8522db7..e3da8f35e6b 100644 --- a/packages/desktop-client/src/hooks/useAccount.ts +++ b/packages/desktop-client/src/hooks/useAccount.ts @@ -4,5 +4,5 @@ import { useAccounts } from './useAccounts'; export function useAccount(id: string) { const accounts = useAccounts(); - return useMemo(() => accounts.find(a => a.id === id), [id]); + return useMemo(() => accounts.find(a => a.id === id), [id, accounts]); } diff --git a/packages/desktop-client/src/hooks/useDateFormat.ts b/packages/desktop-client/src/hooks/useDateFormat.ts index 93b1b30451e..e22293e202a 100644 --- a/packages/desktop-client/src/hooks/useDateFormat.ts +++ b/packages/desktop-client/src/hooks/useDateFormat.ts @@ -1,5 +1,5 @@ import { useSelector } from 'react-redux'; export function useDateFormat() { - return useSelector(state => state.prefs.local?.dateFormat || undefined); + return useSelector(state => state.prefs.local?.dateFormat); } diff --git a/packages/desktop-client/src/hooks/usePayee.ts b/packages/desktop-client/src/hooks/usePayee.ts index 56eefd0f9c6..2606c60a875 100644 --- a/packages/desktop-client/src/hooks/usePayee.ts +++ b/packages/desktop-client/src/hooks/usePayee.ts @@ -4,5 +4,5 @@ import { usePayees } from './usePayees'; export function usePayee(id: string) { const payees = usePayees(); - return useMemo(() => payees.find(p => p.id === id), [id]); + return useMemo(() => payees.find(p => p.id === id), [id, payees]); }