Skip to content

Commit 76ae87a

Browse files
committed
refactor: tanstack & zustand overhaul
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent 43dda1f commit 76ae87a

5 files changed

Lines changed: 957 additions & 1111 deletions

File tree

src/renderer/context/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
128128
markNotificationsAsRead,
129129
markNotificationsAsDone,
130130
unsubscribeNotification,
131-
} = useNotifications(accounts);
131+
} = useNotifications();
132132

133133
// Periodic account refreshes
134-
useAccounts(accounts);
134+
useAccounts();
135135

136136
// Theme
137137
useEffect(() => {

src/renderer/hooks/useAccounts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { Constants } from '../constants';
66

77
import { useAccountsStore } from '../stores';
88

9-
import type { Account } from '../types';
10-
119
interface AccountsState {
1210
refetchAccounts: () => Promise<void>;
1311
}
1412

15-
export const useAccounts = (accounts: Account[]): AccountsState => {
13+
export const useAccounts = (): AccountsState => {
14+
const accounts = useAccountsStore((state) => state.accounts);
15+
1616
const { refetch } = useQuery<boolean, Error>({
1717
queryKey: ['accounts', accounts.length],
1818

0 commit comments

Comments
 (0)