fix: confirm review submission and kill buffer on submit

This commit is contained in:
Lucas Sta Maria 2025-08-27 17:17:36 +08:00
parent 22007c8a75
commit 9db3929117
Signed by: lucas
GPG key ID: F07FB16A826E3B47

View file

@ -393,13 +393,17 @@ Collects review body and inline comments from current buffer."
(or (not body) (string-empty-p (string-trim body))))
(error "Review body is required for %s events" event))
(unless (ghpr--create-review ghpr--review-repo-name
(when (yes-or-no-p (format "Submit review (%s)? " event))
(if (ghpr--create-review ghpr--review-repo-name
pr-number
commit-sha
(or body "")
event
api-comments)
(message "Failed to submit review"))))
(progn
(message "Review submitted successfully")
(kill-buffer (current-buffer)))
(message "Failed to submit review")))))
(defun ghpr-review-comment ()
"Submit review comments with COMMENT event."