Spaces:
Building
Building
Update flare-ui/src/app/services/conversation-manager.service.ts
Browse files
flare-ui/src/app/services/conversation-manager.service.ts
CHANGED
@@ -137,23 +137,23 @@ export class ConversationManagerService implements OnDestroy {
|
|
137 |
|
138 |
stopConversation(): void {
|
139 |
try {
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
} catch (error) {
|
155 |
-
|
156 |
-
|
157 |
}
|
158 |
}
|
159 |
|
|
|
137 |
|
138 |
stopConversation(): void {
|
139 |
try {
|
140 |
+
// First stop audio recording
|
141 |
+
this.audioService.stopRecording();
|
142 |
+
|
143 |
+
// Send conversation end signal
|
144 |
+
if (this.wsService.isConnected()) {
|
145 |
+
this.wsService.sendControl('stop_conversation'); // stop_session yerine
|
146 |
+
}
|
147 |
+
|
148 |
+
// Small delay before disconnecting
|
149 |
+
setTimeout(() => {
|
150 |
+
this.cleanup();
|
151 |
+
this.addSystemMessage('Conversation ended');
|
152 |
+
}, 100);
|
153 |
+
|
154 |
} catch (error) {
|
155 |
+
console.error('Error stopping conversation:', error);
|
156 |
+
this.cleanup();
|
157 |
}
|
158 |
}
|
159 |
|