[database] serverTimeOffset

This commit is contained in:
Salakar
2017-10-05 12:45:54 +01:00
parent 870cb4ebe1
commit 701491df18
2 changed files with 12 additions and 5 deletions

View File

@@ -250,10 +250,10 @@ export default class Reference extends ReferenceBase {
*/
push(value: any, onComplete?: Function): Reference | Promise {
if (value === null || value === undefined) {
return new Reference(this._database, `${this.path}/${generatePushID(this._database.serverTimeOffset)}`);
return new Reference(this._database, `${this.path}/${generatePushID(this._database._serverTimeOffset)}`);
}
const newRef = new Reference(this._database, `${this.path}/${generatePushID(this._database.serverTimeOffset)}`);
const newRef = new Reference(this._database, `${this.path}/${generatePushID(this._database._serverTimeOffset)}`);
const promise = newRef.set(value);
// if callback provided then internally call the set promise with value