@@ -921,7 +921,7 @@ export class MultiTabSyncEngine extends SyncEngine
921
921
// The primary state is set to `true` or `false` immediately after Firestore
922
922
// startup. In the interim, a client should only be considered primary if
923
923
// `isPrimary` is true.
924
- private isPrimary : undefined | boolean = undefined ;
924
+ private _isPrimaryClient : undefined | boolean = undefined ;
925
925
926
926
constructor (
927
927
protected localStore : MultiTabLocalStore ,
@@ -940,7 +940,7 @@ export class MultiTabSyncEngine extends SyncEngine
940
940
}
941
941
942
942
get isPrimaryClient ( ) : boolean {
943
- return this . isPrimary === true ;
943
+ return this . _isPrimaryClient === true ;
944
944
}
945
945
946
946
enableNetwork ( ) : Promise < void > {
@@ -967,7 +967,7 @@ export class MultiTabSyncEngine extends SyncEngine
967
967
const viewSnapshot = queryView . view . synchronizeWithPersistedState (
968
968
queryResult
969
969
) ;
970
- if ( this . isPrimary ) {
970
+ if ( this . _isPrimaryClient ) {
971
971
this . updateTrackedLimbos ( queryView . targetId , viewSnapshot . limboChanges ) ;
972
972
}
973
973
return viewSnapshot ;
@@ -1034,7 +1034,7 @@ export class MultiTabSyncEngine extends SyncEngine
1034
1034
}
1035
1035
1036
1036
async applyPrimaryState ( isPrimary : boolean ) : Promise < void > {
1037
- if ( isPrimary === true && this . isPrimary !== true ) {
1037
+ if ( isPrimary === true && this . _isPrimaryClient !== true ) {
1038
1038
// Secondary tabs only maintain Views for their local listeners and the
1039
1039
// Views internal state may not be 100% populated (in particular
1040
1040
// secondary tabs don't track syncedDocuments, the set of documents the
@@ -1046,12 +1046,12 @@ export class MultiTabSyncEngine extends SyncEngine
1046
1046
activeTargets . toArray ( ) ,
1047
1047
/*transitionToPrimary=*/ true
1048
1048
) ;
1049
- this . isPrimary = true ;
1049
+ this . _isPrimaryClient = true ;
1050
1050
await this . remoteStore . applyPrimaryState ( true ) ;
1051
1051
for ( const targetData of activeQueries ) {
1052
1052
this . remoteStore . listen ( targetData ) ;
1053
1053
}
1054
- } else if ( isPrimary === false && this . isPrimary !== false ) {
1054
+ } else if ( isPrimary === false && this . _isPrimaryClient !== false ) {
1055
1055
const activeTargets : TargetId [ ] = [ ] ;
1056
1056
1057
1057
let p = Promise . resolve ( ) ;
@@ -1076,7 +1076,7 @@ export class MultiTabSyncEngine extends SyncEngine
1076
1076
/*transitionToPrimary=*/ false
1077
1077
) ;
1078
1078
this . resetLimboDocuments ( ) ;
1079
- this . isPrimary = false ;
1079
+ this . _isPrimaryClient = false ;
1080
1080
await this . remoteStore . applyPrimaryState ( false ) ;
1081
1081
}
1082
1082
}
@@ -1191,7 +1191,7 @@ export class MultiTabSyncEngine extends SyncEngine
1191
1191
state : QueryTargetState ,
1192
1192
error ?: FirestoreError
1193
1193
) : Promise < void > {
1194
- if ( this . isPrimary ) {
1194
+ if ( this . _isPrimaryClient ) {
1195
1195
// If we receive a target state notification via WebStorage, we are
1196
1196
// either already secondary or another tab has taken the primary lease.
1197
1197
logDebug ( LOG_TAG , 'Ignoring unexpected query state notification.' ) ;
@@ -1231,7 +1231,7 @@ export class MultiTabSyncEngine extends SyncEngine
1231
1231
added : TargetId [ ] ,
1232
1232
removed : TargetId [ ]
1233
1233
) : Promise < void > {
1234
- if ( ! this . isPrimary ) {
1234
+ if ( ! this . _isPrimaryClient ) {
1235
1235
return ;
1236
1236
}
1237
1237
0 commit comments