mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Prevent WebSocket provider remount by defaulting to V1 (#11458)
This commit is contained in:
parent
9d19292619
commit
9520da668c
@ -154,7 +154,7 @@ function AppContent() {
|
||||
t,
|
||||
]);
|
||||
|
||||
const isV1Conversation = conversation?.conversation_version === "V1";
|
||||
const isV0Conversation = conversation?.conversation_version === "V0";
|
||||
|
||||
const content = (
|
||||
<ConversationSubscriptionsProvider>
|
||||
@ -174,15 +174,11 @@ function AppContent() {
|
||||
</ConversationSubscriptionsProvider>
|
||||
);
|
||||
|
||||
// Wait for conversation data to load before rendering WebSocket provider
|
||||
// This prevents the provider from unmounting/remounting when version changes from 0 to 1
|
||||
if (!conversation) {
|
||||
return content;
|
||||
}
|
||||
|
||||
// Render WebSocket provider immediately to avoid mount/remount cycles
|
||||
// The providers internally handle waiting for conversation data to be ready
|
||||
return (
|
||||
<WebSocketProviderWrapper
|
||||
version={isV1Conversation ? 1 : 0}
|
||||
version={isV0Conversation ? 0 : 1}
|
||||
conversationId={conversationId}
|
||||
>
|
||||
{content}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user