Skip to content

Commit af4f02a

Browse files
committed
fix: no last task type in js
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
1 parent d441a7c commit af4f02a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/assistant.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,14 @@ async function getLastSelectedTaskType() {
409409
},
410410
}
411411
const url = generateUrl('/apps/assistant/config')
412-
return axios.get(url, req)
412+
return axios.get(url, req).catch(error => {
413+
if (error.response?.status === 404) {
414+
console.debug(t('assistant', 'No last task type available, falling back to default'))
415+
return { data: 'chatty-llm' }
416+
}
417+
418+
console.error(error)
419+
})
413420
}
414421

415422
async function saveLastTargetLanguage(targetLanguage) {

0 commit comments

Comments
 (0)