File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,12 @@ class Widget {
5858 case 'ready' :
5959 this . setState ( this . state ) ;
6060 break ;
61+ case 'sync-started' :
62+ this . handleSyncStarted ( ) ;
63+ break ;
64+ // For backward compatibility with rs.js <= 2.0.0-beta.6
6165 case 'sync-req-done' :
62- this . syncInProgress = true ;
63- this . rsSyncButton . classList . add ( "rs-rotate" ) ;
64- setTimeout ( ( ) => {
65- if ( ! this . syncInProgress ) return ;
66- this . rsConnectedLabel . textContent = 'Synchronizing' ;
67- } , 1000 ) ;
66+ this . handleSyncStarted ( ) ;
6867 break ;
6968 case 'sync-done' :
7069 if ( this . online && ! msg . completed ) return ;
@@ -500,6 +499,15 @@ class Widget {
500499 this . close ( ) ;
501500 }
502501
502+ handleSyncStarted ( ) {
503+ this . syncInProgress = true ;
504+ this . rsSyncButton . classList . add ( "rs-rotate" ) ;
505+ setTimeout ( ( ) => {
506+ if ( ! this . syncInProgress ) return ;
507+ this . rsConnectedLabel . textContent = 'Synchronizing' ;
508+ } , 1000 ) ;
509+ }
510+
503511 handleDiscoveryError ( error ) {
504512 let msgContainer = document . querySelector ( '.rs-sign-in-error' ) ;
505513 msgContainer . innerHTML = error . message ;
You can’t perform that action at this time.
0 commit comments