Skip to content

Commit

Permalink
fix(chat): Remove useless ref
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Jul 20, 2024
1 parent 15d520e commit 6290426
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/pages/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<div ref="scrollAreaRef" class="col-grow overflow-auto" style="max-height: calc(100vh - 190px)">
<!-- Display message history -->
<q-list class="col-grow q-ma-xl">
<!-- TODO: find a key -->
<!-- eslint-disable-next-line vue/valid-v-for -->
<q-item
v-for="(message, message_index) in chatRef!.messages"
Expand Down Expand Up @@ -190,7 +189,6 @@ const settingsStore = useSettingsStore();
// Local page state
const inputTextRef = ref('');
const isLoadingRef = ref(false);
const hasResetRef = ref(false);
const inputRef = ref(null);
const scrollAreaRef = ref<HTMLDivElement>();
const enableEditRef = ref(false);
Expand Down Expand Up @@ -313,7 +311,6 @@ async function generatePersonaMessage() {
try {
// Set loading state
isLoadingRef.value = true;
hasResetRef.value = false;
// NOTE: assuming last message is guaranteed to be non-empty and the user's last message
// Get the last message from the user
Expand Down Expand Up @@ -400,7 +397,6 @@ async function generatePersonaMessage() {
} finally {
// Done! update the local state to reflect the end of the process
isLoadingRef.value = false;
hasResetRef.value = false;
chatRef.value.messages = [...chatRef.value.messages];
}
}
Expand Down Expand Up @@ -507,7 +503,7 @@ async function updateChatMessageContent(messageIndex: number, content: string, i
}
}
async function copyMessage(message: Message) {
async function copyMessage(message: UIMessage) {
await copyToClipboard(message.content);
$q.notify('Message copied to clipboard');
}
Expand All @@ -527,8 +523,6 @@ async function clearCookies() {
await axios.get('https://curated.aleph.cloud/change-pool', {
withCredentials: true,
});
// Set the reset flag
hasResetRef.value = true;
}
// function openKnowledgeUploader() {
Expand Down

0 comments on commit 6290426

Please sign in to comment.