Skip to content

Commit d470a28

Browse files
authored
Merge pull request #235 from nextcloud/fix/flashing-skeleton
fix(ChattyLLMInputForm): hide flashing skeleton message on session load
2 parents 00f194a + f29805f commit d470a28

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/components/ChattyLLM/ChattyLLMInputForm.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,25 +265,23 @@ export default {
265265
watch: {
266266
async active() {
267267
this.allMessagesLoaded = false
268+
this.loading.llmGeneration = false
269+
this.loading.titleGeneration = false
268270
this.chatContent = ''
269271
this.msgCursor = 0
270272
this.messages = []
271273
this.editingTitle = false
272274
this.$refs.inputComponent.focus()
273275
274-
if (this.active !== null && !this.loading.newSession) {
275-
this.loading.llmGeneration = true
276-
this.loading.titleGeneration = true
277-
await this.fetchMessages()
278-
this.scrollToBottom()
279-
} else {
280-
// when no active session or creating a new session
281-
this.loading.llmGeneration = false
282-
this.loading.titleGeneration = false
276+
if (this.active === null || this.loading.newSession) {
283277
this.allMessagesLoaded = true
284278
this.loading.newSession = false
285279
return
286280
}
281+
282+
await this.fetchMessages()
283+
this.scrollToBottom()
284+
287285
// start polling in case a message is currently being generated
288286
try {
289287
const sessionId = this.active.id
@@ -299,6 +297,7 @@ export default {
299297
this.active.agencyAnswered = false
300298
if (checkSessionResponseData.messageTaskId !== null) {
301299
try {
300+
this.loading.llmGeneration = true
302301
const message = await this.pollGenerationTask(checkSessionResponseData.messageTaskId, sessionId)
303302
console.debug('checkTaskPolling result:', message)
304303
this.messages.push(message)
@@ -310,6 +309,7 @@ export default {
310309
}
311310
if (checkSessionResponseData.titleTaskId !== null) {
312311
try {
312+
this.loading.titleGeneration = true
313313
const titleResponse = await this.pollTitleGenerationTask(checkSessionResponseData.titleTaskId, sessionId)
314314
const titleResponseData = titleResponse.data
315315
console.debug('checkTaskPolling result:', titleResponse)

0 commit comments

Comments
 (0)