Spaces:
Running
Running
fix app reset
Browse files- static/digiyatra.html +21 -5
static/digiyatra.html
CHANGED
@@ -419,11 +419,27 @@
|
|
419 |
});
|
420 |
},
|
421 |
resetConversation() {
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
scrollToBottom() {
|
428 |
const container = this.$refs.messageContainer;
|
429 |
container.scrollTop = container.scrollHeight;
|
|
|
419 |
});
|
420 |
},
|
421 |
resetConversation() {
|
422 |
+
this.conversationId = uuid.v4();
|
423 |
+
this.messages = [{ type: 'bot', content: 'How can I help you with DigiYatra?' }];
|
424 |
+
this.selectedOptions = {};
|
425 |
+
this.userInput = '';
|
426 |
+
this.isScrollingUp = false;
|
427 |
+
this.lastScrollTop = 0;
|
428 |
+
|
429 |
+
// Reset scroll position
|
430 |
+
this.$nextTick(() => {
|
431 |
+
if (this.$refs.messageContainer) {
|
432 |
+
this.$refs.messageContainer.scrollTop = 0;
|
433 |
+
}
|
434 |
+
});
|
435 |
+
|
436 |
+
// Ensure header and input area are visible
|
437 |
+
const header = document.querySelector('.chat-header');
|
438 |
+
const inputArea = document.querySelector('.input-area');
|
439 |
+
if (header) header.classList.remove('header-hidden');
|
440 |
+
if (inputArea) inputArea.classList.remove('input-hidden');
|
441 |
+
},
|
442 |
+
|
443 |
scrollToBottom() {
|
444 |
const container = this.$refs.messageContainer;
|
445 |
container.scrollTop = container.scrollHeight;
|