Skip to content

Commit f55015f

Browse files
this
1 parent 976b416 commit f55015f

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

packages/database/src/api/Reference.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class Reference extends Query {
142142
this.repo,
143143
this.path,
144144
newVal,
145-
null,
145+
/*priority=*/ null,
146146
deferred.wrapCallback(onComplete)
147147
);
148148
return deferred.promise;

packages/database/src/core/Repo.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,7 @@ export function repoStart(repo: Repo): void {
193193
);
194194

195195
// Minor hack: Fire onConnect immediately, since there's no actual connection.
196-
setTimeout(
197-
function (connectStatus: boolean) {
198-
repoOnConnectStatus(this, connectStatus);
199-
}.bind(repo, true),
200-
0
201-
);
196+
setTimeout(() => repoOnConnectStatus(repo, /* connectStatus= */ true), 0);
202197
} else {
203198
const authOverride = repo.app.options['databaseAuthVariableOverride'];
204199
// Validate authOverride
@@ -807,7 +802,7 @@ export function repoCallOnCompleteCallback(
807802
}
808803

809804
export function repoGetDatabase(repo: Repo): Database {
810-
return repo.__database || (repo.__database = new Database(this));
805+
return repo.__database || (repo.__database = new Database(repo));
811806
}
812807

813808
/**
@@ -830,7 +825,7 @@ export function repoStartTransaction(
830825

831826
// Add a watch to make sure we get server updates.
832827
const valueCallback = function () {};
833-
const watchRef = new Reference(this, path);
828+
const watchRef = new Reference(repo, path);
834829
watchRef.on('value', valueCallback);
835830
const unwatcher = function () {
836831
watchRef.off('value', valueCallback);
@@ -873,7 +868,7 @@ export function repoStartTransaction(
873868
// We just set the input snapshot, so this cast should be safe
874869
const snapshot = new DataSnapshot(
875870
transaction.currentInputSnapshot,
876-
new Reference(this, transaction.path),
871+
new Reference(repo, transaction.path),
877872
PRIORITY_INDEX
878873
);
879874
transaction.onComplete(null, false, snapshot);
@@ -936,7 +931,7 @@ export function repoStartTransaction(
936931
);
937932
eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events);
938933

939-
repoSendReadyTransactions(repo, this.transactionQueueTree_);
934+
repoSendReadyTransactions(repo, repo.transactionQueueTree_);
940935
}
941936
}
942937

@@ -1069,7 +1064,7 @@ function repoSendTransactionQueue(
10691064
repo.transactionQueueTree_.subTree(path)
10701065
);
10711066
// There may be pending transactions that we can now send.
1072-
repoSendReadyTransactions(repo, this.transactionQueueTree_);
1067+
repoSendReadyTransactions(repo, repo.transactionQueueTree_);
10731068

10741069
eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events);
10751070

0 commit comments

Comments
 (0)