diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-07-31 23:13:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-31 17:13:31 +0200 |
commit | 2c2f75cb2cf0de6fdeeb931377873dd07ffbe774 (patch) | |
tree | 11b92d9b0d76f688dc799f534203dfc435cdda7c /web_src | |
parent | 66b623c2aa6b6e6b6d93e20c8ce3d4588a4ec101 (diff) | |
download | gitea-2c2f75cb2cf0de6fdeeb931377873dd07ffbe774.tar.gz gitea-2c2f75cb2cf0de6fdeeb931377873dd07ffbe774.zip |
Fix default merge style (#20564)
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/js/components/PullRequestMergeForm.vue | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/web_src/js/components/PullRequestMergeForm.vue b/web_src/js/components/PullRequestMergeForm.vue index 08b1f9cb86..64ba98728e 100644 --- a/web_src/js/components/PullRequestMergeForm.vue +++ b/web_src/js/components/PullRequestMergeForm.vue @@ -145,7 +145,10 @@ export default { created() { this.mergeStyleAllowedCount = this.mergeForm.mergeStyles.reduce((v, msd) => v + (msd.allowed ? 1 : 0), 0); - this.switchMergeStyle(this.mergeForm.mergeStyles.find((e) => e.allowed)?.name, !this.mergeForm.canMergeNow); + + let mergeStyle = this.mergeForm.mergeStyles.find((e) => e.allowed && e.name === this.mergeForm.defaultMergeStyle)?.name; + if (!mergeStyle) mergeStyle = this.mergeForm.mergeStyles.find((e) => e.allowed)?.name; + this.switchMergeStyle(mergeStyle, !this.mergeForm.canMergeNow); }, mounted() { |