diff options
author | yp05327 <576951401@qq.com> | 2023-09-14 12:54:25 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-14 03:54:25 +0000 |
commit | 076eca81587a286b2392e37beddc6d92a1849bb5 (patch) | |
tree | 5da0a32b69289387d749710ba973ab92cd1a7e68 /web_src/js | |
parent | b32998b3f55bfb4acebe78810fde94838eb75918 (diff) | |
download | gitea-076eca81587a286b2392e37beddc6d92a1849bb5.tar.gz gitea-076eca81587a286b2392e37beddc6d92a1849bb5.zip |
Fix incorrect default branch label while switching between branches (#27053)
Fix #27008
Diffstat (limited to 'web_src/js')
-rw-r--r-- | web_src/js/components/RepoBranchTagSelector.vue | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/web_src/js/components/RepoBranchTagSelector.vue b/web_src/js/components/RepoBranchTagSelector.vue index b64b66d181..30bff6d23f 100644 --- a/web_src/js/components/RepoBranchTagSelector.vue +++ b/web_src/js/components/RepoBranchTagSelector.vue @@ -190,16 +190,15 @@ const sfc = { } this.isLoading = true; try { - // the "data.defaultBranch" is ambiguous, it could be "branch name" or "tag name" const reqUrl = `${this.repoLink}/${this.mode}/list`; const resp = await fetch(reqUrl); const {results} = await resp.json(); for (const result of results) { let selected = false; if (this.mode === 'branches') { - selected = result === this.defaultBranch; + selected = result === this.defaultSelectedRefName; } else { - selected = result === (this.release ? this.release.tagName : this.defaultBranch); + selected = result === (this.release ? this.release.tagName : this.defaultSelectedRefName); } this.items.push({name: result, url: pathEscapeSegments(result), branch: this.mode === 'branches', tag: this.mode === 'tags', selected}); } @@ -276,7 +275,7 @@ export default sfc; // activate IDE's Vue plugin <div class="loading-indicator is-loading" v-if="isLoading"/> <div v-for="(item, index) in filteredItems" :key="item.name" class="item" :class="{selected: item.selected, active: active === index}" @click="selectItem(item)" :ref="'listItem' + index"> {{ item.name }} - <div class="ui label" v-if="item.name===defaultBranch && mode === 'branches'"> + <div class="ui label" v-if="item.name===repoDefaultBranch && mode === 'branches'"> {{ textDefaultBranchLabel }} </div> <a v-show="enableFeed && mode === 'branches'" role="button" class="rss-icon gt-float-right" :href="rssURLPrefix + item.url" target="_blank" @click.stop> |