File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
packages/firestore/src/local Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -966,7 +966,7 @@ export class IndexedDbPersistence implements Persistence {
966
966
return this . shutdown ( ) ;
967
967
} ) ;
968
968
} ;
969
- this . window . addEventListener ( 'unload ' , this . windowUnloadHandler ) ;
969
+ this . window . addEventListener ( 'pagehide ' , this . windowUnloadHandler ) ;
970
970
}
971
971
}
972
972
@@ -976,7 +976,7 @@ export class IndexedDbPersistence implements Persistence {
976
976
typeof this . window ?. removeEventListener === 'function' ,
977
977
"Expected 'window.removeEventListener' to be a function"
978
978
) ;
979
- this . window ! . removeEventListener ( 'unload ' , this . windowUnloadHandler ) ;
979
+ this . window ! . removeEventListener ( 'pagehide ' , this . windowUnloadHandler ) ;
980
980
this . windowUnloadHandler = null ;
981
981
}
982
982
}
Original file line number Diff line number Diff line change @@ -613,7 +613,7 @@ export class WebStorageSharedClientState implements SharedClientState {
613
613
614
614
// Register a window unload hook to remove the client metadata entry from
615
615
// WebStorage even if `shutdown()` was not called.
616
- this . window . addEventListener ( 'unload ' , ( ) => this . shutdown ( ) ) ;
616
+ this . window . addEventListener ( 'pagehide ' , ( ) => this . shutdown ( ) ) ;
617
617
618
618
this . started = true ;
619
619
}
You can’t perform that action at this time.
0 commit comments