Skip to content

Commit bd668e7

Browse files
committed
feat: handle empty store tools in ToolStoreDialog
1 parent 823ac6b commit bd668e7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

apps/tools/serializers/tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def get_appstore_tools(self):
766766
os.unlink(temp_zip_path)
767767
except requests.RequestException as e:
768768
maxkb_logger.error(f"fetch appstore tools error: {e}")
769-
return []
769+
return {'apps': [], 'additionalProperties': {'tags': []}}
770770

771771
class AddStoreTool(serializers.Serializer):
772772
user_id = serializers.UUIDField(required=True, label=_("User ID"))

ui/src/views/tool/toolStore/ToolStoreDialog.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ async function getStoreToolList() {
175175
const tags = res.data.additionalProperties.tags
176176
const storeTools = res.data.apps
177177
178+
if (storeTools.length === 0) {
179+
filterList.value = []
180+
return
181+
}
182+
178183
categories.value = tags.map((tag: any) => ({
179184
id: tag.key,
180185
title: tag.name, // 国际化

0 commit comments

Comments
 (0)