Block send until extensions are ready (#4271)

This commit is contained in:
Jack Amadeo
2025-08-22 11:45:25 -04:00
committed by GitHub
parent 9d9fb0609d
commit 24b76baa55
7 changed files with 157 additions and 106 deletions
+4
View File
@@ -21,6 +21,7 @@ interface ChatContextType {
clearDraft: () => void;
// Context identification
contextKey: string; // 'hub' or 'pair-{sessionId}'
agentWaitingMessage: string | null;
}
const ChatContext = createContext<ChatContextType | undefined>(undefined);
@@ -30,12 +31,14 @@ interface ChatProviderProps {
chat: ChatType;
setChat: (chat: ChatType) => void;
contextKey?: string; // Optional context key, defaults to 'hub'
agentWaitingMessage: string | null;
}
export const ChatProvider: React.FC<ChatProviderProps> = ({
children,
chat,
setChat,
agentWaitingMessage,
contextKey = 'hub',
}) => {
const draftContext = useDraftContext();
@@ -108,6 +111,7 @@ export const ChatProvider: React.FC<ChatProviderProps> = ({
setDraft,
clearDraft,
contextKey,
agentWaitingMessage,
};
return <ChatContext.Provider value={value}>{children}</ChatContext.Provider>;