File tree Expand file tree Collapse file tree
apps/mobile/src/features/threads Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,17 @@ function useKeySet(newlineSeparatedKeys: string): ReadonlySet<string> {
2727
2828type LayoutInput = Parameters < typeof buildThreadListV2Items > [ 0 ] ;
2929
30+ /**
31+ * The React Compiler memoizes on the values a callback reads and drops unread entries from a
32+ * dependency list, so the version that marks an expired grace must be read to rebuild the list.
33+ */
34+ function observeInbox (
35+ threads : Parameters < typeof threadListInboxReturns . observe > [ 0 ] ,
36+ _expiredGraceVersion : number ,
37+ ) {
38+ return threadListInboxReturns . observe ( threads ) ;
39+ }
40+
3041/**
3142 * Home's and the thread sidebar's thread list. Its result is one value a screen only reads:
3243 * built inline, the list's inputs stayed open to mutation across the screen's other hooks, so
@@ -62,8 +73,7 @@ export function useThreadListV2(input: {
6273 threadListInboxReturns . getSnapshot ,
6374 ) ;
6475 const inbox = useMemo (
65- ( ) => threadListInboxReturns . observe ( workingShelfEnabled ? threads : null ) ,
66- // oxlint-disable-next-line react/memo-dependencies -- the version signals an expired grace
76+ ( ) => observeInbox ( workingShelfEnabled ? threads : null , inboxVersion ) ,
6777 [ threads , workingShelfEnabled , inboxVersion ] ,
6878 ) ;
6979 // Up/down menu availability for every card, computed once per section per
You can’t perform that action at this time.
0 commit comments