Augment the custom event types and make the dep arrays honest. [skip build]
This commit is contained in:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user