Spaces:
Sleeping
Sleeping
Update application/static/js/components/chat.js
Browse files
application/static/js/components/chat.js
CHANGED
@@ -23,8 +23,14 @@ class Chat{
|
|
23 |
|
24 |
try {
|
25 |
if(this.uiManager.initializer.convId==null){
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
this.uiManager.textBox.value='';
|
30 |
this.uiManager.sendBtn.disabled = true;
|
|
|
23 |
|
24 |
try {
|
25 |
if(this.uiManager.initializer.convId==null){
|
26 |
+
// Use the new createConv method in Initialize
|
27 |
+
const newConvId = await this.uiManager.initializer.createConv();
|
28 |
+
if (!newConvId) { // Check for error
|
29 |
+
console.error("Failed to create new conversation.");
|
30 |
+
return; // Exit if creation failed
|
31 |
+
}
|
32 |
+
payload["convId"] = newConvId; // Use the returned convId
|
33 |
+
|
34 |
}
|
35 |
this.uiManager.textBox.value='';
|
36 |
this.uiManager.sendBtn.disabled = true;
|