File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,11 @@ export interface IToolbarState {
110
110
* Panel tab identifier.
111
111
*/
112
112
tab : number ;
113
+
114
+ /**
115
+ * Boolean indicating whether a refresh is currently in progress.
116
+ */
117
+ refreshInProgress : boolean ;
113
118
}
114
119
115
120
/**
@@ -126,7 +131,8 @@ export class Toolbar extends React.Component<IToolbarProps, IToolbarState> {
126
131
super ( props ) ;
127
132
this . state = {
128
133
branchMenu : false ,
129
- tab : 0
134
+ tab : 0 ,
135
+ refreshInProgress : false
130
136
} ;
131
137
}
132
138
@@ -218,6 +224,7 @@ export class Toolbar extends React.Component<IToolbarProps, IToolbarState> {
218
224
className = { toolbarButtonClass }
219
225
icon = { refreshIcon }
220
226
onClick = { this . _onRefreshClick }
227
+ disabled = { this . state . refreshInProgress }
221
228
title = { this . props . trans . __ (
222
229
'Refresh the repository to detect local and remote changes'
223
230
) }
@@ -432,6 +439,9 @@ export class Toolbar extends React.Component<IToolbarProps, IToolbarState> {
432
439
'in-progress' ,
433
440
{ autoClose : false }
434
441
) ;
442
+
443
+ this . setState ( { refreshInProgress : true } ) ;
444
+
435
445
try {
436
446
await this . props . model . refresh ( ) ;
437
447
@@ -449,6 +459,8 @@ export class Toolbar extends React.Component<IToolbarProps, IToolbarState> {
449
459
type : 'error' ,
450
460
...showError ( error , this . props . trans )
451
461
} ) ;
462
+ } finally {
463
+ this . setState ( { refreshInProgress : false } ) ;
452
464
}
453
465
} ;
454
466
}
You can’t perform that action at this time.
0 commit comments