This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
The following commit(s) were added to refs/heads/main by this push:
new a00f6604 fix: can't show tag description in tag edit page (#664)
a00f6604 is described below
commit a00f6604118383ff907a17824af3d4eb8e4a08a7
Author: Han Gao <[email protected]>
AuthorDate: Thu Nov 30 14:42:09 2023 +0800
fix: can't show tag description in tag edit page (#664)
fix #637 .
---
ui/src/pages/Tags/Edit/index.tsx | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/ui/src/pages/Tags/Edit/index.tsx b/ui/src/pages/Tags/Edit/index.tsx
index c1f51487..c737353c 100644
--- a/ui/src/pages/Tags/Edit/index.tsx
+++ b/ui/src/pages/Tags/Edit/index.tsx
@@ -70,9 +70,6 @@ const Index = () => {
const { data } = useTagInfo({ id: tagId });
const { data: revisions = [] } = useQueryRevisions(data?.tag_id);
- initFormData.displayName.value = data?.display_name || '';
- initFormData.slugName.value = data?.slug_name || '';
- initFormData.description.value = data?.original_text || '';
const [formData, setFormData] = useState<FormDataItem>(initFormData);
const [immData, setImmData] = useState(initFormData);
const [contentChanged, setContentChanged] = useState(false);
@@ -85,6 +82,14 @@ const Index = () => {
when: contentChanged,
});
+ useEffect(() => {
+ initFormData.displayName.value = data?.display_name || '';
+ initFormData.slugName.value = data?.slug_name || '';
+ initFormData.description.value = data?.original_text || '';
+ setFormData(initFormData);
+ setImmData(initFormData);
+ }, [data]);
+
useEffect(() => {
const { displayName, slugName, description, editSummary } = formData;
const {
@@ -92,9 +97,6 @@ const Index = () => {
slugName: slug_name,
description: original_text,
} = immData;
- if (!display_name || !slug_name || !original_text) {
- return;
- }
if (
display_name.value !== displayName.value ||