File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
packages/auth/src/platform_browser/persistence Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -358,24 +358,29 @@ class IndexedDBLocalPersistence implements InternalPersistence {
358
358
return new DBPromise < DBObject [ ] | null > ( getAllRequest ) . toPromise ( ) ;
359
359
} ) ;
360
360
361
- if ( ! result || result . length === 0 ) {
361
+ if ( ! result ) {
362
362
return [ ] ;
363
363
}
364
364
365
+ console . log ( 'result length: ' , result . length ) ;
366
+
365
367
// If we have pending writes in progress abort, we'll get picked up on the next poll
366
368
if ( this . pendingWrites !== 0 ) {
367
369
return [ ] ;
368
370
}
369
371
370
372
const keys = [ ] ;
371
373
const keysInResult = new Set ( ) ;
372
- for ( const { fbase_key : key , value } of result ) {
373
- keysInResult . add ( key ) ;
374
- if ( JSON . stringify ( this . localCache [ key ] ) !== JSON . stringify ( value ) ) {
375
- this . notifyListeners ( key , value as PersistenceValue ) ;
376
- keys . push ( key ) ;
374
+ if ( result . length !== 0 ) {
375
+ for ( const { fbase_key : key , value } of result ) {
376
+ keysInResult . add ( key ) ;
377
+ if ( JSON . stringify ( this . localCache [ key ] ) !== JSON . stringify ( value ) ) {
378
+ this . notifyListeners ( key , value as PersistenceValue ) ;
379
+ keys . push ( key ) ;
380
+ }
377
381
}
378
382
}
383
+
379
384
for ( const localKey of Object . keys ( this . localCache ) ) {
380
385
if ( this . localCache [ localKey ] && ! keysInResult . has ( localKey ) ) {
381
386
// Deleted
You can’t perform that action at this time.
0 commit comments