diff options
author | Marcel Klehr <mklehr@gmx.net> | 2023-09-07 14:40:18 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2023-11-16 10:54:30 +0100 |
commit | cdbbd648b1e74754bf0f1cc78d5491fd29ec25ca (patch) | |
tree | f34d36176b132bec8f1b76a3dd4fef2a0c0e1695 | |
parent | 8a7a89f42cc2a92c8041e83512eac1e25ef8ff55 (diff) | |
download | nextcloud-server-cdbbd648b1e74754bf0f1cc78d5491fd29ec25ca.tar.gz nextcloud-server-cdbbd648b1e74754bf0f1cc78d5491fd29ec25ca.zip |
Fix Admin AI settings javascript error
make sure all task types we want to display actually exist
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
-rw-r--r-- | apps/settings/src/components/AdminAI.vue | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/settings/src/components/AdminAI.vue b/apps/settings/src/components/AdminAI.vue index 174c9000a9e..c63fbb3091f 100644 --- a/apps/settings/src/components/AdminAI.vue +++ b/apps/settings/src/components/AdminAI.vue @@ -38,7 +38,7 @@ </NcSettingsSection> <NcSettingsSection :title="t('settings', 'Text processing')" :description="t('settings', 'Text processing tasks can be implemented by different apps. Here you can set which app should be used for which task.')"> - <template v-for="type in Object.keys(settings['ai.textprocessing_provider_preferences'])"> + <template v-for="type in tpTaskTypes"> <div :key="type"> <h3>{{ t('settings', 'Task:') }} {{ getTaskType(type).name }}</h3> <p>{{ getTaskType(type).description }}</p> @@ -110,6 +110,9 @@ export default { hasTextProcessing() { return Object.keys(this.settings['ai.textprocessing_provider_preferences']).length > 0 && Array.isArray(this.textProcessingTaskTypes) }, + tpTaskTypes() { + return Object.keys(this.settings['ai.textprocessing_provider_preferences']).filter(type => !!this.getTaskType(type)) + }, }, methods: { moveUp(i) { |