Augment the custom event types and make the dep arrays honest. [skip build]
Checks / checks (push) Successful in 2m7s
Trigger cinny-mobile / dispatch (push) Successful in 2s

This commit is contained in:
2026-11-02 05:12:35 +11:00
parent b85a2b9290
commit fea879497c
14 changed files with 64 additions and 51 deletions
+3 -11
View File
@@ -348,7 +348,6 @@ function ForumThreadDetailBody({
setReplyToEventId(rootEventId);
}
}, [replyDraft, rootEventId]);
const [contentRevision, setContentRevision] = useState(0);
const [collapsedBranches, setCollapsedBranches] = useState<Set<string>>(() => new Set());
const localDropRef = useRef<HTMLDivElement>(null);
const dropRef = fileDropContainerRef ?? localDropRef;
@@ -393,14 +392,8 @@ function ForumThreadDetailBody({
handleComposerSent();
}, [handleComposerSent]);
useForumRoomLiveUpdates(
[room],
() => {
setContentRevision((revision) => revision + 1);
reloadThread();
},
{ threadRootId: rootEventId, wait: 150 },
);
// post is the reactive source: reloadThread pushes the local thread back through onPostUpdate
useForumRoomLiveUpdates([room], reloadThread, { threadRootId: rootEventId, wait: 150 });
const rootEvent = room.findEventById(rootEventId);
const rootEditing = editEventId === rootEventId;
@@ -424,7 +417,6 @@ function ForumThreadDetailBody({
const handleEditRootClose = useCallback(() => {
setEditEventId(undefined);
setContentRevision((revision) => revision + 1);
handleComposerSent();
}, [handleComposerSent]);
@@ -476,7 +468,7 @@ function ForumThreadDetailBody({
const title = useMemo(() => {
const local = loadPostThreadLocal(mx, roomId, rootEventId);
return local?.title || post.title || titleHint || '(untitled post)';
}, [contentRevision, mx, post.title, roomId, rootEventId, titleHint]);
}, [mx, post.title, roomId, rootEventId, titleHint]);
return (
<article ref={localDropRef} className={theme.ForumTopicDetailRoot} data-event-id={post.eventId}>