fix(ui): make Finish review button work again (#6818)

I bricked the Finish review button in https://codeberg.org/forgejo/forgejo/pulls/6729 because I was naive and thought there are no mines laid within JS. I was wrong, because review panel was expected to be a child of review button. I switched both selectors to context of reviewBox.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6818
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
This commit is contained in:
0ko 2025-02-07 10:01:09 +00:00 committed by Gusted
parent 2645c0824f
commit b7065b7748
2 changed files with 27 additions and 2 deletions

View file

@ -517,8 +517,8 @@ export function initRepoPullRequestReview() {
// The following part is only for diff views
if (!$('.repository.pull.diff').length) return;
const $reviewBtn = $('.js-btn-review');
const $panel = $reviewBtn.parent().find('.review-box-panel');
const $reviewBtn = $reviewBox.parent().find('.js-btn-review');
const $panel = $reviewBox.parent().find('.review-box-panel');
const $closeBtn = $panel.find('.close');
if ($reviewBtn.length && $panel.length) {