@@ -265,25 +265,23 @@ export default {
265
265
watch: {
266
266
async active () {
267
267
this .allMessagesLoaded = false
268
+ this .loading .llmGeneration = false
269
+ this .loading .titleGeneration = false
268
270
this .chatContent = ' '
269
271
this .msgCursor = 0
270
272
this .messages = []
271
273
this .editingTitle = false
272
274
this .$refs .inputComponent .focus ()
273
275
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 ) {
283
277
this .allMessagesLoaded = true
284
278
this .loading .newSession = false
285
279
return
286
280
}
281
+
282
+ await this .fetchMessages ()
283
+ this .scrollToBottom ()
284
+
287
285
// start polling in case a message is currently being generated
288
286
try {
289
287
const sessionId = this .active .id
@@ -299,6 +297,7 @@ export default {
299
297
this .active .agencyAnswered = false
300
298
if (checkSessionResponseData .messageTaskId !== null ) {
301
299
try {
300
+ this .loading .llmGeneration = true
302
301
const message = await this .pollGenerationTask (checkSessionResponseData .messageTaskId , sessionId)
303
302
console .debug (' checkTaskPolling result:' , message)
304
303
this .messages .push (message)
@@ -310,6 +309,7 @@ export default {
310
309
}
311
310
if (checkSessionResponseData .titleTaskId !== null ) {
312
311
try {
312
+ this .loading .titleGeneration = true
313
313
const titleResponse = await this .pollTitleGenerationTask (checkSessionResponseData .titleTaskId , sessionId)
314
314
const titleResponseData = titleResponse .data
315
315
console .debug (' checkTaskPolling result:' , titleResponse)
0 commit comments