File tree 2 files changed +9
-13
lines changed 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -361,14 +361,10 @@ export class ChannelManager {
361
361
362
362
if ( ! this . client . offlineDb . syncManager . syncStatus ) {
363
363
// FIXME: Should only schedule for true syncStatus, not otherwise
364
- this . client . offlineDb . syncManager . scheduleSyncStatusChangeCallback (
365
- async ( syncStatus ) => {
366
- console . log ( 'WILL TRY NOW VAL: ' , syncStatus ) ;
367
- if ( syncStatus ) {
368
- await queryChannelsRequest ( ) ;
369
- }
370
- } ,
371
- ) ;
364
+ this . client . offlineDb . syncManager . scheduleSyncStatusChangeCallback ( async ( ) => {
365
+ console . log ( 'WILL TRY NOW RUNNING SCHEDULED NOW !' ) ;
366
+ await queryChannelsRequest ( ) ;
367
+ } ) ;
372
368
return ;
373
369
}
374
370
// await queryChannelsRequest();
Original file line number Diff line number Diff line change @@ -881,12 +881,12 @@ export class OfflineDBSyncManager {
881
881
this . syncStatus = status ;
882
882
this . syncStatusListeners . forEach ( ( l ) => l ( status ) ) ;
883
883
884
- console . log ( 'WILL TRY LISTENERS' , this . scheduledSyncStatusCallbacks . length ) ;
885
- const promises = this . scheduledSyncStatusCallbacks . map ( ( cb ) => cb ( status ) ) ;
886
- await Promise . all ( promises ) ;
887
- console . log ( 'DONE LISTENERS !' ) ;
884
+ if ( status ) {
885
+ const promises = this . scheduledSyncStatusCallbacks . map ( ( cb ) => cb ( status ) ) ;
886
+ await Promise . all ( promises ) ;
888
887
889
- this . scheduledSyncStatusCallbacks = [ ] ;
888
+ this . scheduledSyncStatusCallbacks = [ ] ;
889
+ }
890
890
} ;
891
891
892
892
private handleEventToSyncDB = async ( event : Event , flush ?: boolean ) => {
You can’t perform that action at this time.
0 commit comments