Block send until extensions are ready (#4271)
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user