File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
src/webviews/apps/plus/home/components Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,10 @@ export class GlBranchSection extends LitElement {
58
58
@property ( { type : Boolean } ) isFetching = false ;
59
59
60
60
private renderSectionLabel ( ) {
61
- if ( this . isFetching ) {
61
+ if ( this . isFetching || this . branches . length === 0 ) {
62
62
return this . label ;
63
63
}
64
- if ( ! this . branches . length ) {
65
- return `No ${ this . label } branches` ;
66
- }
64
+
67
65
return `${ this . label } (${ this . branches . length } )` ;
68
66
}
69
67
@@ -75,6 +73,14 @@ export class GlBranchSection extends LitElement {
75
73
${ this . branches . map (
76
74
branch => html `< gl-branch-card .repo =${ this . repo } .branch =${ branch } > </ gl-branch-card > ` ,
77
75
) }
76
+ ${ when (
77
+ this . branches . length > 0 ,
78
+ ( ) =>
79
+ this . branches . map (
80
+ branch => html `< gl-branch-card .repo =${ this . repo } .branch =${ branch } > </ gl-branch-card > ` ,
81
+ ) ,
82
+ ( ) => html `< p > No ${ this . label } branches</ p > ` ,
83
+ ) }
78
84
</ gl-section >
79
85
` ;
80
86
}
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ export class GlOverview extends SignalWatcher(LitElement) {
96
96
const { repository } = overview ;
97
97
return html `
98
98
< gl-branch-section
99
- label ="Recent "
99
+ label ="recent "
100
100
.isFetching =${ isFetching }
101
101
.repo =${ repository . path }
102
102
.branches=${ repository . branches . recent }
@@ -120,7 +120,7 @@ export class GlOverview extends SignalWatcher(LitElement) {
120
120
this . _overviewState . filter . stale ?. show === true ,
121
121
( ) => html `
122
122
< gl-branch-section
123
- label ="Stale "
123
+ label ="stale "
124
124
.repo =${ repository . path }
125
125
.branches =${ repository . branches . stale }
126
126
> </ gl-branch-section >
You can’t perform that action at this time.
0 commit comments