@@ -331,32 +331,57 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
331
331
[ auth , settings , unsubscribeNotification ] ,
332
332
) ;
333
333
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
+
334
384
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 >
361
386
) ;
362
387
} ;
0 commit comments