vzcode 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"
|
|
21
21
|
rel="stylesheet"
|
|
22
22
|
/>
|
|
23
|
-
<script type="module" crossorigin src="/assets/index-
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-DB93Pffa.js"></script>
|
|
24
24
|
<link rel="stylesheet" crossorigin href="/assets/index-BoFeK4GL.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
package/package.json
CHANGED
|
@@ -244,5 +244,8 @@ export interface VZCodeProviderProps {
|
|
|
244
244
|
chatId: string;
|
|
245
245
|
}>;
|
|
246
246
|
iframeRef?: React.MutableRefObject<HTMLIFrameElement>;
|
|
247
|
-
handleChatError?: (
|
|
247
|
+
handleChatError?: (
|
|
248
|
+
error: string,
|
|
249
|
+
message?: string,
|
|
250
|
+
) => void;
|
|
248
251
|
}
|
|
@@ -299,10 +299,10 @@ export const useVZCodeState = ({
|
|
|
299
299
|
|
|
300
300
|
// Create the combined setAIErrorMessage function that calls both state setter and external callback
|
|
301
301
|
const setAIErrorMessage = useCallback(
|
|
302
|
-
(error: string | null) => {
|
|
302
|
+
(error: string | null, message?: string) => {
|
|
303
303
|
setAIErrorMessageState(error);
|
|
304
304
|
if (error && handleChatError) {
|
|
305
|
-
handleChatError(error);
|
|
305
|
+
handleChatError(error, message);
|
|
306
306
|
}
|
|
307
307
|
},
|
|
308
308
|
[handleChatError],
|
|
@@ -440,7 +440,10 @@ export const useVZCodeState = ({
|
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
// For other errors, show the error message
|
|
443
|
-
setAIErrorMessage(
|
|
443
|
+
setAIErrorMessage(
|
|
444
|
+
errorMessage,
|
|
445
|
+
messageContent.trim(),
|
|
446
|
+
);
|
|
444
447
|
return;
|
|
445
448
|
}
|
|
446
449
|
|
|
@@ -450,6 +453,7 @@ export const useVZCodeState = ({
|
|
|
450
453
|
console.error('Error getting AI response:', error);
|
|
451
454
|
setAIErrorMessage(
|
|
452
455
|
'Failed to send message. Please try again.',
|
|
456
|
+
messageContent.trim(),
|
|
453
457
|
);
|
|
454
458
|
}
|
|
455
459
|
},
|
|
@@ -13,6 +13,8 @@ const DEBUG = false;
|
|
|
13
13
|
|
|
14
14
|
const showSuggestedRequests = false;
|
|
15
15
|
|
|
16
|
+
const showPreviousChats = false;
|
|
17
|
+
|
|
16
18
|
// Component for displaying the list of existing chats
|
|
17
19
|
const ChatList = ({
|
|
18
20
|
chats,
|
|
@@ -184,7 +186,7 @@ export const AIChat = () => {
|
|
|
184
186
|
<div className="ai-chat-empty-text">
|
|
185
187
|
How can I help you?
|
|
186
188
|
</div>
|
|
187
|
-
{hasExistingChats && (
|
|
189
|
+
{hasExistingChats && showPreviousChats && (
|
|
188
190
|
<ChatList
|
|
189
191
|
chats={existingChats}
|
|
190
192
|
selectedChatId={selectedChatId}
|