diff --git a/lib/Controller/AssistantController.php b/lib/Controller/AssistantController.php index abf40207..425cdc68 100644 --- a/lib/Controller/AssistantController.php +++ b/lib/Controller/AssistantController.php @@ -63,7 +63,7 @@ public function getAssistantTaskResultPage(int $taskId): TemplateResponse { public function getAssistantStandalonePage(): TemplateResponse { if ($this->userId !== null) { $task = new Task( - $this->config->getUserValue($this->userId, Application::APP_ID, 'last_task_type'), + $this->config->getUserValue($this->userId, Application::APP_ID, 'last_task_type', 'chatty-llm'), ['something' => ''], Application::APP_ID, $this->userId, diff --git a/src/assistant.js b/src/assistant.js index 45177dfa..58ccbda5 100644 --- a/src/assistant.js +++ b/src/assistant.js @@ -409,7 +409,14 @@ async function getLastSelectedTaskType() { }, } const url = generateUrl('/apps/assistant/config') - return axios.get(url, req) + return axios.get(url, req).catch(error => { + if (error.response?.status === 404) { + console.debug(t('assistant', 'No last task type available, falling back to default')) + return { data: 'chatty-llm' } + } + + console.error(error) + }) } async function saveLastTargetLanguage(targetLanguage) {