From 6e9595f33bf5bf54809f3d12306150fa9ef8acec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E7=92=87?= <37972689+er-pai-r@users.noreply.github.com> Date: Wed, 30 Aug 2023 20:54:00 +0800 Subject: [PATCH] fix: file tag list bug (#5616) * fix: file tag list bug * Feat: add default value --- frontend/src/components/dialog/edit-filetag-dialog.js | 2 +- frontend/src/components/dirent-detail/detail-list-view.js | 6 +++++- frontend/src/components/dirent-detail/file-details.js | 2 +- .../rich-markdown-editor/detail-list-view.js | 6 +++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/dialog/edit-filetag-dialog.js b/frontend/src/components/dialog/edit-filetag-dialog.js index 6dc5709c42..14114fa83d 100644 --- a/frontend/src/components/dialog/edit-filetag-dialog.js +++ b/frontend/src/components/dialog/edit-filetag-dialog.js @@ -40,7 +40,7 @@ class TagItem extends React.Component { getRepoTagIdList = () => { let repoTagIdList = []; - let fileTagList = this.props.fileTagList; + let fileTagList = this.props.fileTagList || []; repoTagIdList = fileTagList.map((fileTag) => fileTag.repo_tag_id); return repoTagIdList; } diff --git a/frontend/src/components/dirent-detail/detail-list-view.js b/frontend/src/components/dirent-detail/detail-list-view.js index 5afeb07f55..28461174d1 100644 --- a/frontend/src/components/dirent-detail/detail-list-view.js +++ b/frontend/src/components/dirent-detail/detail-list-view.js @@ -94,7 +94,7 @@ class DetailListView extends React.Component { {gettext('Tags')}