File tree Expand file tree Collapse file tree
DexieNETCloudSample/Dexie/Services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,20 +89,22 @@ await DB.Transaction(async t =>
8989 if ( NotificationsState . Value is NotificationState . Subscribed )
9090 {
9191 await UnsubscribePush ( ) ;
92+ await Sync ( new SyncOptions ( ) ) ;
9293 }
9394 return Observable . Return ( Unit . Default ) ;
9495 } ) ;
9596
9697 var stopObservable = Observable
9798 . FromAsync ( async _ =>
9899 {
99- if ( await DB . NumUnsyncedChanges ( ) == 0 && SyncState . Value . ValidPhase ( ) )
100+ var unsyncedChanges = await DB . NumUnsyncedChanges ( ) ;
101+ if ( unsyncedChanges == 0 && SyncState . Value . ValidPhase ( ) )
100102 {
101103 await DB . Logout ( ) ;
102104 }
103105 else
104106 {
105- throw new InvalidOperationException ( $ "Can not logout: { SyncState . Value ? . Phase } ") ;
107+ throw new InvalidOperationException ( $ "Can not logout: { SyncState . Value ? . Phase } - { unsyncedChanges } unsynced changes ") ;
106108 }
107109
108110 return Observable . Return ( Unit . Default ) ;
You can’t perform that action at this time.
0 commit comments