Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): finished threads leave Working once the grace ends #28169

Mergedplaycations(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/28169/headmerged by maria-rcks View on GitHub

Showing 1 changed file with 12 additions and 2 deletions.

x
0 of 1 viewed, 1 left
12 additions and 2 deletionsapps/mobile/src/features/threads/useThreadListV2.tsModified
View file
@@ -27,6 +27,17 @@
​
type LayoutInput = Parameters<typeof buildThreadListV2Items>[0];
​
+/**
+ * The React Compiler memoizes on the values a callback reads and drops unread entries from a
+ * dependency list, so the version that marks an expired grace must be read to rebuild the list.
+ */
+function observeInbox(
+ threads: Parameters<typeof threadListInboxReturns.observe>[0],
+ _expiredGraceVersion: number,
+) {
+ return threadListInboxReturns.observe(threads);
+}
+​
/**
* Home's and the thread sidebar's thread list. Its result is one value a screen only reads:
* built inline, the list's inputs stayed open to mutation across the screen's other hooks, so
@@ -62,8 +73,7 @@
threadListInboxReturns.getSnapshot,
);
const inbox = useMemo(
- () => threadListInboxReturns.observe(workingShelfEnabled ? threads : null),
- // oxlint-disable-next-line react/memo-dependencies -- the version signals an expired grace
+ () => observeInbox(workingShelfEnabled ? threads : null, inboxVersion),
[threads, workingShelfEnabled, inboxVersion],
);
// Up/down menu availability for every card, computed once per section per