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)))) (or (not body) (string-empty-p (string-trim body))))
(error "Review body is required for %s events" event)) (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))
pr-number (if (ghpr--create-review ghpr--review-repo-name
commit-sha pr-number
(or body "") commit-sha
event (or body "")
api-comments) event
(message "Failed to submit review")))) api-comments)
(progn
(message "Review submitted successfully")
(kill-buffer (current-buffer)))
(message "Failed to submit review")))))
(defun ghpr-review-comment () (defun ghpr-review-comment ()
"Submit review comments with COMMENT event." "Submit review comments with COMMENT event."