File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/userData/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import { registerAndGetAmdImageURL } from 'vs/base/common/amd';
2323import { ResourceContextKey } from 'vs/workbench/common/resources' ;
2424import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
2525import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles' ;
26+ import { Event } from 'vs/base/common/event' ;
2627
2728const CONTEXT_SYNC_STATE = new RawContextKey < string > ( 'syncStatus' , SyncStatus . Uninitialized ) ;
2829
@@ -50,16 +51,14 @@ class UserDataSyncContribution extends Disposable implements IWorkbenchContribut
5051 ) {
5152 super ( ) ;
5253 this . loopSync ( ) ;
53- this . _register ( this . configurationService . onDidChangeConfiguration ( e => {
54- if ( e . affectsConfiguration ( 'userConfiguration.enableSync' ) && this . configurationService . getValue < boolean > ( 'userConfiguration.enableSync' ) ) {
55- this . sync ( ) ;
56- }
57- } ) ) ;
54+ this . _register ( Event . filter ( this . configurationService . onDidChangeConfiguration ,
55+ e => e . affectsConfiguration ( 'userConfiguration.enableSync' ) && this . configurationService . getValue < boolean > ( 'userConfiguration.enableSync' ) )
56+ ( ( ) => this . sync ( ) ) ) ;
5857 }
5958
6059 private loopSync ( ) : void {
6160 this . sync ( )
62- . then ( ( ) => timeout ( 1000 * 60 * 5 ) ) // every five minutes
61+ . then ( ( ) => timeout ( 500 ) )
6362 . then ( ( ) => this . loopSync ( ) ) ;
6463 }
6564
You can’t perform that action at this time.
0 commit comments