@@ -92,8 +92,14 @@ export default class PushPullComponent {
92
92
< button className = 'git-PushPull-item btn' onclick = { ( ) => this . fetch ( ) } disabled = { this . viewModel . hasRequestsInFlight ( ) } > Fetch</ button >
93
93
94
94
< div className = 'git-PushPull-item is-flexible btn-group' >
95
- { this . renderPullButton ( ) }
96
- { this . renderPushButton ( ) }
95
+ < button className = 'btn' onclick = { ( ) => this . pull ( ) } disabled = { this . viewModel . hasRequestsInFlight ( ) } >
96
+ < span className = 'icon icon-arrow-down' />
97
+ { this . labelForPullButton ( ) }
98
+ </ button >
99
+ < button className = 'btn' onclick = { ( ) => this . push ( ) } disabled = { this . viewModel . hasRequestsInFlight ( ) } >
100
+ < span className = 'icon icon-arrow-up' />
101
+ { this . labelForPushButton ( ) }
102
+ </ button >
97
103
</ div >
98
104
</ div >
99
105
{ this . renderProgress ( ) }
@@ -103,24 +109,12 @@ export default class PushPullComponent {
103
109
/*eslint-enable*/
104
110
}
105
111
106
- renderPushButton ( ) {
107
- let label = this . viewModel . getAheadCount ( ) === 0 ? 'Push' : `Push (${ this . viewModel . getAheadCount ( ) } )`
108
- return (
109
- < button className = 'btn' onclick = { ( ) => this . push ( ) } disabled = { this . viewModel . hasRequestsInFlight ( ) } >
110
- < span className = 'icon icon-arrow-up' />
111
- { label }
112
- </ button >
113
- )
112
+ labelForPullButton ( ) {
113
+ return this . viewModel . getBehindCount ( ) === 0 ? 'Pull' : `Pull (${ this . viewModel . getBehindCount ( ) } )`
114
114
}
115
115
116
- renderPullButton ( ) {
117
- let label = this . viewModel . getBehindCount ( ) === 0 ? 'Pull' : `Pull (${ this . viewModel . getBehindCount ( ) } )`
118
- return (
119
- < button className = 'btn' onclick = { ( ) => this . pull ( ) } disabled = { this . viewModel . hasRequestsInFlight ( ) } >
120
- < span className = 'icon icon-arrow-down' />
121
- { label }
122
- </ button >
123
- )
116
+ labelForPushButton ( ) {
117
+ return this . viewModel . getAheadCount ( ) === 0 ? 'Push' : `Push (${ this . viewModel . getAheadCount ( ) } )`
124
118
}
125
119
126
120
async performOperation ( fn : ( ) => Promise < void > ) : Promise < void > {
0 commit comments