Skip to content

Commit 44ba6ae

Browse files
committed
refactor: context lint issue
Signed-off-by: Adam Setch <[email protected]>
1 parent 8775986 commit 44ba6ae

File tree

1 file changed

+51
-26
lines changed

1 file changed

+51
-26
lines changed

src/renderer/context/App.tsx

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -331,32 +331,57 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
331331
[auth, settings, unsubscribeNotification],
332332
);
333333

334+
const contextValues = useMemo(
335+
() => ({
336+
auth,
337+
isLoggedIn,
338+
loginWithGitHubApp,
339+
loginWithOAuthApp,
340+
loginWithPersonalAccessToken,
341+
logoutFromAccount,
342+
343+
status,
344+
globalError,
345+
346+
notifications,
347+
fetchNotifications: fetchNotificationsWithAccounts,
348+
349+
markNotificationsAsRead: markNotificationsAsReadWithAccounts,
350+
markNotificationsAsDone: markNotificationsAsDoneWithAccounts,
351+
unsubscribeNotification: unsubscribeNotificationWithAccounts,
352+
353+
settings,
354+
clearFilters,
355+
resetSettings,
356+
updateSetting,
357+
updateFilter,
358+
}),
359+
[
360+
auth,
361+
isLoggedIn,
362+
loginWithGitHubApp,
363+
loginWithOAuthApp,
364+
loginWithPersonalAccessToken,
365+
logoutFromAccount,
366+
367+
status,
368+
globalError,
369+
370+
notifications,
371+
fetchNotificationsWithAccounts,
372+
markNotificationsAsReadWithAccounts,
373+
markNotificationsAsDoneWithAccounts,
374+
unsubscribeNotificationWithAccounts,
375+
376+
settings,
377+
clearFilters,
378+
resetSettings,
379+
updateSetting,
380+
updateFilter,
381+
],
382+
);
383+
334384
return (
335-
<AppContext.Provider
336-
value={{
337-
auth,
338-
isLoggedIn,
339-
loginWithGitHubApp,
340-
loginWithOAuthApp,
341-
loginWithPersonalAccessToken,
342-
logoutFromAccount,
343-
344-
notifications,
345-
status,
346-
globalError,
347-
fetchNotifications: fetchNotificationsWithAccounts,
348-
markNotificationsAsRead: markNotificationsAsReadWithAccounts,
349-
markNotificationsAsDone: markNotificationsAsDoneWithAccounts,
350-
unsubscribeNotification: unsubscribeNotificationWithAccounts,
351-
352-
settings,
353-
clearFilters,
354-
resetSettings,
355-
updateSetting,
356-
updateFilter,
357-
}}
358-
>
359-
{children}
360-
</AppContext.Provider>
385+
<AppContext.Provider value={contextValues}>{children}</AppContext.Provider>
361386
);
362387
};

0 commit comments

Comments
 (0)