From be801e335aa3d053b8a922022b29721e5beea0b7 Mon Sep 17 00:00:00 2001 From: Logan Yang Date: Mon, 3 Apr 2023 14:16:31 -0700 Subject: [PATCH] Add back running dots effect --- src/copilotView.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/copilotView.ts b/src/copilotView.ts index 0000e9fc..95ecfab0 100644 --- a/src/copilotView.ts +++ b/src/copilotView.ts @@ -181,14 +181,14 @@ export default class CopilotChatView extends ItemView { // Your ChatGPT API interaction logic here console.log(`Sending message: ${message}`); - // const {loadingMessageEl, dotInterval} = this.createLoadingDots(chatMessages); + const {loadingMessageEl, dotInterval} = this.createLoadingDots(chatMessages); // Get a response from the ChatGPT API const chatGPTResponse = await this.getChatGPTResponse(message); // Stop the running "..." effect - // clearInterval(dotInterval); - // if (loadingMessageEl.parentElement) { - // loadingMessageEl.parentElement.remove(); - // } + clearInterval(dotInterval); + if (loadingMessageEl.parentElement) { + loadingMessageEl.parentElement.remove(); + } // After receiving a response from the ChatGPT API, append it to the chat interface this.appendMessage(chatMessages, chatGPTResponse, this.model); this.scrollToBottom(chatMessages);