Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: can't show tag description in tag edit page #664

Merged
merged 3 commits into from
Nov 30, 2023
Merged

Conversation

hgaol
Copy link
Member

@hgaol hgaol commented Nov 28, 2023

fix #637 .

...formData.description,
value: data?.original_text || '',
},
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may have overlooked immData. immData is used to record the initial value. When the user changes the content and leaves the page, there will be a prompt; therefore, you need to add an assignment operation to immData here;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @shuashuai , updated. There's one thing makes me confused that for below codes.

    useEffect(() => {
    ....
    if (!display_name || !slug_name || !original_text) {
      return;
    }
    ....
    }

Seems it'll never go into this condition branch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @shuashuai , updated. There's one thing makes me confused that for below codes.

    useEffect(() => {
    ....
    if (!display_name || !slug_name || !original_text) {
      return;
    }
    ....
    }

Seems it'll never go into this condition branch.

Yes, you can remove this condition now! In addition, for the previous assignment operation, you can simplify the code and use an object to assign the value. Try to reduce the number of lines of code! Thank you for your thoughts and suggestions!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved. please help to review and let me know if any comment. thanks!

@hgaol hgaol requested a review from shuashuai November 29, 2023 13:07
@shuashuai shuashuai merged commit a00f660 into apache:main Nov 30, 2023
4 checks passed
LinkinStars pushed a commit that referenced this pull request Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't show tag description in tag edit page
2 participants