Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export async function openAssistantForm({
let lastTask = null

modalMountPoint.addEventListener('cancel', () => {
cancelTaskPolling()
app.unmount()
reject(new Error('User cancellation'))
})
Expand Down Expand Up @@ -312,6 +313,7 @@ export async function pollTask(taskId, obj, callback = updateTask) {
console.debug('[assistant] poll request failed', error)
if (error.status === 404) {
clearInterval(window.assistantPollTimerId)
window.assistantPollTimerId = null
reject(new Error('task-not-found'))
return
}
Expand Down Expand Up @@ -521,6 +523,7 @@ export async function openAssistantTask(
let lastTask = task

modalMountPoint.addEventListener('cancel', () => {
cancelTaskPolling()
app.unmount()
})
modalMountPoint.addEventListener('submit', (data) => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/ChattyLLM/ChattyLLMInputForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ import InputArea from './InputArea.vue'
import NoSession from './NoSession.vue'
import AgencyConfirmation from './AgencyConfirmation.vue'

import axios from '@nextcloud/axios'
import axios, { isCancel } from '@nextcloud/axios'
import { showError } from '@nextcloud/dialogs'
import { generateUrl, generateOcsUrl } from '@nextcloud/router'
import { loadState } from '@nextcloud/initial-state'
Expand Down Expand Up @@ -345,7 +345,7 @@ export default {
},
},

onDestroy() {
beforeUnmount() {
if (this.pollMessageGenerationTimerId) {
clearInterval(this.pollMessageGenerationTimerId)
}
Expand Down Expand Up @@ -591,7 +591,7 @@ export default {
this.loading.initialMessages = false
this.messagesAxiosController = null
} catch (error) {
if (axios.isCancel(error)) {
if (isCancel(error)) {
console.debug('fetchMessages cancelled')
return
}
Expand Down
Loading