Skip to content

Commit

Permalink
Fix hooks deps
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Feb 3, 2024
1 parent e2c4606 commit 1210806
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/desktop-client/src/hooks/useAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
2 changes: 1 addition & 1 deletion packages/desktop-client/src/hooks/useDateFormat.ts
Original file line number Diff line number Diff line change
@@ -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);
}
2 changes: 1 addition & 1 deletion packages/desktop-client/src/hooks/usePayee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

0 comments on commit 1210806

Please sign in to comment.