Skip to content

Commit be79b34

Browse files
committed
add more comments
1 parent 57aef6d commit be79b34

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

routers/web/repo/release.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,13 @@ func NewReleasePost(ctx *context.Context) {
407407
return
408408
}
409409

410-
// we should still show the "tag only" button if the user clicks it, no matter the release exists or not.
411-
// because if error occurs, end users need to have the chance to edit the name and submit the form with "tag-only" again.
410+
// We should still show the "tag only" button if the user clicks it, no matter the release exists or not.
411+
// Because if error occurs, end users need to have the chance to edit the name and submit the form with "tag-only" again.
412+
// It is still not completely right, because there could still be cases like this:
413+
// * user visit "new release" page, see the "tag only" button
414+
// * input something, click other buttons but not "tag only"
415+
// * error occurs, the "new release" page is rendered again, but the "tag only" button is gone
416+
// Such cases are not able to be handled by current code, it needs frontend code to toggle the "tag-only" button if the input changes.
412417
ctx.Data["ShowCreateTagOnlyButton"] = form.TagOnly || rel == nil
413418

414419
// do some form checks

0 commit comments

Comments
 (0)