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 JS error when edit the title of merged PR #30988

Closed

Conversation

yp05327
Copy link
Contributor

@yp05327 yp05327 commented May 16, 2024

image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 16, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 16, 2024
const oldTargetBranch = document.querySelector('#branch_target').textContent;
// merged pr can not edit target branch, so they maybe null
const newTargetBranch = document.querySelector('#pull-target-branch')?.getAttribute('data-branch');
const oldTargetBranch = document.querySelector('#branch_target')?.textContent;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for catching the bug, I missed a case.

But I think we shouldn't use ? everywhere, and it doesn't seem right here, it would make newTargetBranch !== oldTargetBranch become true.

-> Fix JS error when editing a merged PR's title #30990

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it is reported from @lunny
I will close this one.

@yp05327 yp05327 closed this May 16, 2024
@yp05327 yp05327 deleted the fix-edit-merged-pr-title-js-error branch May 27, 2024 00:49
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/js size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants