aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/chat-app.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/chat-app.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js b/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js
index 0057218..1d61c43 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js
@@ -278,7 +278,13 @@ function ChatPanel({ transportRef, username, userId, entries, gekRef,
if (!atBottomRef.current) setUnreadFrom(prev => prev ?? id);
};
- return () => { transport.onChat = null; };
+ transport.onChatPurged = () => {
+ setMessages([]);
+ setHasMore(false);
+ setUnreadFrom(null);
+ };
+
+ return () => { transport.onChat = null; transport.onChatPurged = null; };
}, [status]);
const loadOlder = useCallback(async () => {