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 {
110110 * Panel tab identifier.
111111 */
112112 tab : number ;
113+
114+ /**
115+ * Boolean indicating whether a refresh is currently in progress.
116+ */
117+ refreshInProgress : boolean ;
113118}
114119
115120/**
@@ -126,7 +131,8 @@ export class Toolbar extends React.Component<IToolbarProps, IToolbarState> {
126131 super ( props ) ;
127132 this . state = {
128133 branchMenu : false ,
129- tab : 0
134+ tab : 0 ,
135+ refreshInProgress : false
130136 } ;
131137 }
132138
@@ -218,6 +224,7 @@ export class Toolbar extends React.Component<IToolbarProps, IToolbarState> {
218224 className = { toolbarButtonClass }
219225 icon = { refreshIcon }
220226 onClick = { this . _onRefreshClick }
227+ disabled = { this . state . refreshInProgress }
221228 title = { this . props . trans . __ (
222229 'Refresh the repository to detect local and remote changes'
223230 ) }
@@ -432,6 +439,9 @@ export class Toolbar extends React.Component<IToolbarProps, IToolbarState> {
432439 'in-progress' ,
433440 { autoClose : false }
434441 ) ;
442+
443+ this . setState ( { refreshInProgress : true } ) ;
444+
435445 try {
436446 await this . props . model . refresh ( ) ;
437447
@@ -449,6 +459,8 @@ export class Toolbar extends React.Component<IToolbarProps, IToolbarState> {
449459 type : 'error' ,
450460 ...showError ( error , this . props . trans )
451461 } ) ;
462+ } finally {
463+ this . setState ( { refreshInProgress : false } ) ;
452464 }
453465 } ;
454466}
You can’t perform that action at this time.
0 commit comments